Kaydet (Commit) 5915800d authored tarafından Aymeric Augustin's avatar Aymeric Augustin

Merge pull request #1127 from filias/20142

Fixed #20142 -- Added error handling for fixture setup
......@@ -843,13 +843,17 @@ class TestCase(TransactionTestCase):
for db in self._databases_names(include_mirrors=False):
if hasattr(self, 'fixtures'):
call_command('loaddata', *self.fixtures,
**{
'verbosity': 0,
'commit': False,
'database': db,
'skip_validation': True,
})
try:
call_command('loaddata', *self.fixtures,
**{
'verbosity': 0,
'commit': False,
'database': db,
'skip_validation': True,
})
except Exception:
self._fixture_teardown()
raise
def _fixture_teardown(self):
if not connections_support_transactions():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment