diff options
| author | Simon Charette <charette.s@gmail.com> | 2018-11-23 20:59:38 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-11-27 09:35:17 -0500 |
| commit | 84e7a9f4a7bb3cad2bffae97baaae99de152c451 (patch) | |
| tree | c81eeb6edf47ce0abdb7551cd28a3de354dfd20f /tests/basic | |
| parent | 9a7d336c3866c5226ed11868be0234c7e2fa47fa (diff) | |
Switched setUp() to setUpTestData() where possible in Django's tests.
Diffstat (limited to 'tests/basic')
| -rw-r--r-- | tests/basic/tests.py | 7 |
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(). |
