mirror of
https://github.com/django/django.git
synced 2024-12-23 01:25:58 +00:00
Used QuerySet.bulk_create() in a couple of postgres tests.
Follow up to 0ce2ad9ca4
.
This commit is contained in:
parent
dc740dde50
commit
2aaabe2004
@ -104,19 +104,19 @@ class TestSaveLoad(PostgreSQLTestCase):
|
||||
class TestQuerying(PostgreSQLTestCase):
|
||||
@classmethod
|
||||
def setUpTestData(cls):
|
||||
cls.objs = [
|
||||
JSONModel.objects.create(field=None),
|
||||
JSONModel.objects.create(field=True),
|
||||
JSONModel.objects.create(field=False),
|
||||
JSONModel.objects.create(field='yes'),
|
||||
JSONModel.objects.create(field=7),
|
||||
JSONModel.objects.create(field=[]),
|
||||
JSONModel.objects.create(field={}),
|
||||
JSONModel.objects.create(field={
|
||||
cls.objs = JSONModel.objects.bulk_create([
|
||||
JSONModel(field=None),
|
||||
JSONModel(field=True),
|
||||
JSONModel(field=False),
|
||||
JSONModel(field='yes'),
|
||||
JSONModel(field=7),
|
||||
JSONModel(field=[]),
|
||||
JSONModel(field={}),
|
||||
JSONModel(field={
|
||||
'a': 'b',
|
||||
'c': 1,
|
||||
}),
|
||||
JSONModel.objects.create(field={
|
||||
JSONModel(field={
|
||||
'a': 'b',
|
||||
'c': 1,
|
||||
'd': ['e', {'f': 'g'}],
|
||||
@ -125,13 +125,13 @@ class TestQuerying(PostgreSQLTestCase):
|
||||
'j': None,
|
||||
'k': {'l': 'm'},
|
||||
}),
|
||||
JSONModel.objects.create(field=[1, [2]]),
|
||||
JSONModel.objects.create(field={
|
||||
JSONModel(field=[1, [2]]),
|
||||
JSONModel(field={
|
||||
'k': True,
|
||||
'l': False,
|
||||
}),
|
||||
JSONModel.objects.create(field={'foo': 'bar'}),
|
||||
]
|
||||
JSONModel(field={'foo': 'bar'}),
|
||||
])
|
||||
|
||||
def test_exact(self):
|
||||
self.assertSequenceEqual(
|
||||
|
@ -167,13 +167,13 @@ class TestQuerying(PostgreSQLTestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpTestData(cls):
|
||||
cls.objs = [
|
||||
RangesModel.objects.create(ints=NumericRange(0, 10)),
|
||||
RangesModel.objects.create(ints=NumericRange(5, 15)),
|
||||
RangesModel.objects.create(ints=NumericRange(None, 0)),
|
||||
RangesModel.objects.create(ints=NumericRange(empty=True)),
|
||||
RangesModel.objects.create(ints=None),
|
||||
]
|
||||
cls.objs = RangesModel.objects.bulk_create([
|
||||
RangesModel(ints=NumericRange(0, 10)),
|
||||
RangesModel(ints=NumericRange(5, 15)),
|
||||
RangesModel(ints=NumericRange(None, 0)),
|
||||
RangesModel(ints=NumericRange(empty=True)),
|
||||
RangesModel(ints=None),
|
||||
])
|
||||
|
||||
def test_exact(self):
|
||||
self.assertSequenceEqual(
|
||||
|
Loading…
Reference in New Issue
Block a user