diff options
| author | Simon Charette <charette.s@gmail.com> | 2018-11-23 21:24:25 -0500 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2020-05-15 20:22:56 +0200 |
| commit | 94f63b926fd32d7a7b6e2591ef72aa8f040f25cc (patch) | |
| tree | 427aa4855f08fa75d386118765fcb0035ea07052 /tests/admin_utils/tests.py | |
| parent | 3cf80d3fcf7446afdde16a2be515c423f720e54d (diff) | |
Refs #31395 -- Relied on setUpTestData() test data isolation in various tests.
Diffstat (limited to 'tests/admin_utils/tests.py')
| -rw-r--r-- | tests/admin_utils/tests.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/admin_utils/tests.py b/tests/admin_utils/tests.py index cf0d3e064e..8e50556c75 100644 --- a/tests/admin_utils/tests.py +++ b/tests/admin_utils/tests.py @@ -22,9 +22,10 @@ class NestedObjectsTests(TestCase): """ Tests for ``NestedObject`` utility collection. """ - def setUp(self): - self.n = NestedObjects(using=DEFAULT_DB_ALIAS) - self.objs = [Count.objects.create(num=i) for i in range(5)] + @classmethod + def setUpTestData(cls): + cls.n = NestedObjects(using=DEFAULT_DB_ALIAS) + cls.objs = [Count.objects.create(num=i) for i in range(5)] def _check(self, target): self.assertEqual(self.n.nested(lambda obj: obj.num), target) |
