Refs #31395 -- Relied on setUpTestData() test data isolation in various tests.

This commit is contained in:
Simon Charette 2018-11-23 21:24:25 -05:00 committed by Mariusz Felisiak
parent 3cf80d3fcf
commit 94f63b926f
14 changed files with 187 additions and 163 deletions

View file

@ -12,8 +12,9 @@ from .models import (
class BulkUpdateNoteTests(TestCase):
def setUp(self):
self.notes = [
@classmethod
def setUpTestData(cls):
cls.notes = [
Note.objects.create(note=str(i), misc=str(i))
for i in range(10)
]

View file

@ -1962,7 +1962,8 @@ class Queries6Tests(TestCase):
class RawQueriesTests(TestCase):
def setUp(self):
@classmethod
def setUpTestData(cls):
Note.objects.create(note='n1', misc='foo', id=1)
def test_ticket14729(self):
@ -1986,10 +1987,11 @@ class GeneratorExpressionTests(SimpleTestCase):
class ComparisonTests(TestCase):
def setUp(self):
self.n1 = Note.objects.create(note='n1', misc='foo', id=1)
e1 = ExtraInfo.objects.create(info='e1', note=self.n1)
self.a2 = Author.objects.create(name='a2', num=2002, extra=e1)
@classmethod
def setUpTestData(cls):
cls.n1 = Note.objects.create(note='n1', misc='foo', id=1)
e1 = ExtraInfo.objects.create(info='e1', note=cls.n1)
cls.a2 = Author.objects.create(name='a2', num=2002, extra=e1)
def test_ticket8597(self):
# Regression tests for case-insensitive comparisons