Extract specific data to a django fixture
The full documentation is at https://django-fixtures-extractor.readthedocs.io.
Install Django Fixtures Extractor:
pip install django-fixtures-extractor
Add it to your INSTALLED_APPS:
INSTALLED_APPS = (
...
'fixtures_extractor',
...
)
- Make pipinstallable
- Run CI/CD
- Add support for Django 1.11 to 5
- Add supported model fields
- Many to Many with through model
- Add feature: Obfuscate value
- Add feature: Generate schema from model
- Fix tox and pyenv to work together
Does the code actually work?
source <YOURVIRTUALENV>/bin/activate (myenv) $ python runtests.py
pip install -r requirements/requirements_dev.txt pip install -r requirements/requirements_test.txt
- Create the app
$ cd tests/testproject $ python ../../manage.py startapp {APP_NAME}
- Change the
{APP_NAME}Config.name
inside thetests/{APP_NAME}/apps.py
file fortests.testproject.{APP_NAME}.apps.{APP_NAME}
- Add the app to the
INSTALLED_APPS
in the/testproject/testproject/settings.py
file - Write the models that you would use to test on the model folder inside your app
- Create the migrations using
python manage.py makemigrations {APP_NAME}
- Run the migrations using
python manage.py migrate
- Create the tests inside the
tests/tests_orm_extractor.py
file
Based on https://github.com/ascaliaio/django-dumpdata-one
Tools used in rendering this package: