summaryrefslogtreecommitdiff
path: root/tests/contenttypes_tests
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2018-11-23 21:24:25 -0500
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-05-15 20:22:56 +0200
commit94f63b926fd32d7a7b6e2591ef72aa8f040f25cc (patch)
tree427aa4855f08fa75d386118765fcb0035ea07052 /tests/contenttypes_tests
parent3cf80d3fcf7446afdde16a2be515c423f720e54d (diff)
downloaddjango-94f63b926fd32d7a7b6e2591ef72aa8f040f25cc.tar.gz
Refs #31395 -- Relied on setUpTestData() test data isolation in various tests.
Diffstat (limited to 'tests/contenttypes_tests')
-rw-r--r--tests/contenttypes_tests/test_management.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/contenttypes_tests/test_management.py b/tests/contenttypes_tests/test_management.py
index 65842aa09e..57d3757abe 100644
--- a/tests/contenttypes_tests/test_management.py
+++ b/tests/contenttypes_tests/test_management.py
@@ -20,9 +20,12 @@ class RemoveStaleContentTypesTests(TestCase):
'django.contrib.contenttypes',
]
+ @classmethod
+ def setUpTestData(cls):
+ cls.before_count = ContentType.objects.count()
+ cls.content_type = ContentType.objects.create(app_label='contenttypes_tests', model='Fake')
+
def setUp(self):
- self.before_count = ContentType.objects.count()
- self.content_type = ContentType.objects.create(app_label='contenttypes_tests', model='Fake')
self.app_config = apps.get_app_config('contenttypes_tests')
def test_interactive_true_with_dependent_objects(self):