Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1127 from filias/20142

Fixed #20142 -- Added error handling for fixture setup
  • Loading branch information...
commit 5915800debef7cec01672dc0b467b7c2bd3aba03 2 parents dc8814b + 5883ae5
@aaugustin aaugustin authored
Showing with 11 additions and 7 deletions.
  1. +11 −7 django/test/testcases.py
View
18 django/test/testcases.py
@@ -843,13 +843,17 @@ def _fixture_setup(self):
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():

0 comments on commit 5915800

Please sign in to comment.
Something went wrong with that request. Please try again.