django-nose icon indicating copy to clipboard operation
django-nose copied to clipboard

Fixture tearDown doesn't handle constraints well

Open rrauenza opened this issue 11 years ago • 1 comments

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()

rrauenza avatar Feb 28 '14 00:02 rrauenza

There are a number of bugs around fixtures. Can you provide a test case or a public project that reproduces the error?

jwhitlock avatar Jul 02 '15 22:07 jwhitlock