Blog Archive for December 8, 2009

Creating Django Test Fixture

December 8, 2009

To dump the contents of a database to a json format file in order to use it as a test fixture:

./manage.py dumpdata --indent=2 > test_fixture.json

This will dump all applications in a project. Try and keep the size of the fixture down; it is loaded and removed before and …