summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
Diffstat (limited to 'django')
-rw-r--r--django/test/testcases.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/django/test/testcases.py b/django/test/testcases.py
index 6e16cfb247..eed67e9cda 100644
--- a/django/test/testcases.py
+++ b/django/test/testcases.py
@@ -1017,7 +1017,11 @@ class TestCase(TransactionTestCase):
except Exception:
cls._rollback_atomics(cls.cls_atomics)
raise
- cls.setUpTestData()
+ try:
+ cls.setUpTestData()
+ except Exception:
+ cls._rollback_atomics(cls.cls_atomics)
+ raise
@classmethod
def tearDownClass(cls):