Skip to content

matibarriento/django-fixture-extractor

Repository files navigation

Django Fixtures Extractor

https://travis-ci.org/matibarriento/django-fixtures-extractor.svg?branch=master

Extract specific data to a django fixture

Documentation

The full documentation is at https://django-fixtures-extractor.readthedocs.io.

Quickstart

Install Django Fixtures Extractor:

pip install django-fixtures-extractor

Add it to your INSTALLED_APPS:

INSTALLED_APPS = (
    ...
    'fixtures_extractor',
    ...
)

TODO Features

  • Make pipinstallable
  • Run CI/CD

Desired features

  • Add support for Django 1.11 to 5
  • Add supported model fields
  • Add feature: Obfuscate value
  • Add feature: Generate schema from model
  • Fix tox and pyenv to work together

Running Tests

Does the code actually work?

source <YOURVIRTUALENV>/bin/activate
(myenv) $ python runtests.py

Development commands

pip install -r requirements/requirements_dev.txt
pip install -r requirements/requirements_test.txt

How to add a new app and add tests

  1. Create the app
$ cd tests/testproject
$ python ../../manage.py startapp {APP_NAME}
  1. Change the {APP_NAME}Config.name inside the tests/{APP_NAME}/apps.py file for tests.testproject.{APP_NAME}.apps.{APP_NAME}
  2. Add the app to the INSTALLED_APPS in the /testproject/testproject/settings.py file
  3. Write the models that you would use to test on the model folder inside your app
  4. Create the migrations using python manage.py makemigrations {APP_NAME}
  5. Run the migrations using python manage.py migrate
  6. Create the tests inside the tests/tests_orm_extractor.py file

Credits

Based on https://github.com/ascaliaio/django-dumpdata-one

Tools used in rendering this package:

About

Django command to extract partial fixtures

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages