mirror of
https://github.com/django/django.git
synced 2025-11-25 21:22:14 +00:00
Switched setUp() to setUpTestData() where possible in Django's tests.
This commit is contained in:
parent
9a7d336c38
commit
84e7a9f4a7
49 changed files with 421 additions and 334 deletions
|
|
@ -66,14 +66,15 @@ class SimpleTests(PostgreSQLTestCase):
|
|||
|
||||
class TestQuerying(PostgreSQLTestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.objs = [
|
||||
HStoreModel.objects.create(field={'a': 'b'}),
|
||||
HStoreModel.objects.create(field={'a': 'b', 'c': 'd'}),
|
||||
HStoreModel.objects.create(field={'c': 'd'}),
|
||||
HStoreModel.objects.create(field={}),
|
||||
HStoreModel.objects.create(field=None),
|
||||
]
|
||||
@classmethod
|
||||
def setUpTestData(cls):
|
||||
cls.objs = HStoreModel.objects.bulk_create([
|
||||
HStoreModel(field={'a': 'b'}),
|
||||
HStoreModel(field={'a': 'b', 'c': 'd'}),
|
||||
HStoreModel(field={'c': 'd'}),
|
||||
HStoreModel(field={}),
|
||||
HStoreModel(field=None),
|
||||
])
|
||||
|
||||
def test_exact(self):
|
||||
self.assertSequenceEqual(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue