dfg

django-fixture-generator

django-fixture-generator is a reusable django application to make writing fixtures not suck.

Showing:

Popularity

Downloads/wk

0

GitHub Stars

138

Maintenance

Last Commit

10yrs ago

Contributors

4

Package

Dependencies

0

License

UNKNOWN

Categories

Readme

django-fixture-generator

Requires Django 1.2.

  • Add "fixture_generator" to your INSTALLED_APPS setting.

  • Create a fixture_gen.py file in one of your apps. It should look something like:

    from fixture_generator import fixture_generator

    from django.contrib.auth.models import User, Groups

    @fixture_generator(User, requires=["my_app.test_groups"]) def test_users(): muggles, wizards = Group.objects.order_by("name") simon = User.objects.create(username="simon") adrian = User.objects.create(username="adrian") jacob = User.objects.create(username="jacob")

     simon.groups.add(wizards)
     adrian.groups.add(muggles)
     jacob.groups.add(muggles)
    

    @fixture_generator(Group) def test_groups(): Group.objects.create(name="Muggles") Group.objects.create(name="Wizards")

  • Run manage.py generate_fixture my_app.test_users.

  • Save the resulting fixture somewhere.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100