summaryrefslogtreecommitdiff
path: root/tests/basic
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2018-11-23 20:59:38 -0500
committerTim Graham <timograham@gmail.com>2018-11-27 09:35:17 -0500
commit84e7a9f4a7bb3cad2bffae97baaae99de152c451 (patch)
treec81eeb6edf47ce0abdb7551cd28a3de354dfd20f /tests/basic
parent9a7d336c3866c5226ed11868be0234c7e2fa47fa (diff)
downloaddjango-84e7a9f4a7bb3cad2bffae97baaae99de152c451.tar.gz
Switched setUp() to setUpTestData() where possible in Django's tests.
Diffstat (limited to 'tests/basic')
-rw-r--r--tests/basic/tests.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/basic/tests.py b/tests/basic/tests.py
index b3bb4d02cc..909f3049b9 100644
--- a/tests/basic/tests.py
+++ b/tests/basic/tests.py
@@ -372,15 +372,16 @@ class ModelTest(TestCase):
class ModelLookupTest(TestCase):
- def setUp(self):
+ @classmethod
+ def setUpTestData(cls):
# Create an Article.
- self.a = Article(
+ cls.a = Article(
id=None,
headline='Swallow programs in Python',
pub_date=datetime(2005, 7, 28),
)
# Save it into the database. You have to call save() explicitly.
- self.a.save()
+ cls.a.save()
def test_all_lookup(self):
# Change values by changing the attributes, then calling save().