django-nose
django-nose copied to clipboard
Fixture tearDown doesn't handle constraints well
I get constraint errors during fixture teardown. At the moment I'm injecting a db flush to get around it, which seems to work ok.
@classmethod
def _fixture_teardown(cls):
fixtures = getattr(cls, 'fixtures', None)
_fb_should_teardown_fixtures = getattr(cls, '_fb_should_teardown_fixtures', True)
# _fixture_teardown needs help with constraints.
if fixtures and _fb_should_teardown_fixtures:
call_command('flush', interactive=False, verbosity=1)
return super(MyFastFixtureTestCase, cls)._fixture_teardown()
There are a number of bugs around fixtures. Can you provide a test case or a public project that reproduces the error?