class fixture.django_testcase.FixtureTestCase(methodName='runTest')

Bases: django.test.testcases.TransactionTestCase

Overrides django’s fixture setup and teardown code to use DataSets.

Starts a transaction at the begining of a test and rolls it back at the end.

See Using Fixture With Django for a complete example.

This is a list of DataSets that will be created and destroyed for each test method. The result of setting them up will be referenced by the data
Any datasets found are loaded and refereneced here for later teardown

Finds a list called datasets and loads them

This is done in a transaction if possible. I’m not using the settings.DATABASE_SUPPORTS_TRANSACTIONS as I don’t wnat to assume that connection.create_test_db() might not have been called


Finds an attribute called data and runs teardown on it

(data is created by _fixture_setup())

Previous topic


Next topic