Merge pull request #1127 from filias/20142

Fixed #20142 -- Added error handling for fixture setup
This commit is contained in:
Aymeric Augustin 2013-05-18 08:42:36 -07:00
commit 5915800deb
1 changed files with 11 additions and 7 deletions

View File

@ -843,6 +843,7 @@ class TestCase(TransactionTestCase):
for db in self._databases_names(include_mirrors=False):
if hasattr(self, 'fixtures'):
try:
call_command('loaddata', *self.fixtures,
**{
'verbosity': 0,
@ -850,6 +851,9 @@ class TestCase(TransactionTestCase):
'database': db,
'skip_validation': True,
})
except Exception:
self._fixture_teardown()
raise
def _fixture_teardown(self):
if not connections_support_transactions():