Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
b17c1d53
Unverified
Kaydet (Commit)
b17c1d53
authored
Ock 12, 2018
tarafından
Tim Graham
Kaydeden (comit)
GitHub
Ock 12, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removed unused query log clearing in bulk_create tests.
üst
b9cec9fa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
tests.py
tests/bulk_create/tests.py
+7
-10
No files found.
tests/bulk_create/tests.py
Dosyayı görüntüle @
b17c1d53
...
...
@@ -121,11 +121,9 @@ class BulkCreateTests(TestCase):
self
.
assertEqual
(
Restaurant
.
objects
.
count
(),
2
)
def
test_large_batch
(
self
):
with
override_settings
(
DEBUG
=
True
):
connection
.
queries_log
.
clear
()
TwoFields
.
objects
.
bulk_create
([
TwoFields
(
f1
=
i
,
f2
=
i
+
1
)
for
i
in
range
(
0
,
1001
)
])
TwoFields
.
objects
.
bulk_create
([
TwoFields
(
f1
=
i
,
f2
=
i
+
1
)
for
i
in
range
(
0
,
1001
)
])
self
.
assertEqual
(
TwoFields
.
objects
.
count
(),
1001
)
self
.
assertEqual
(
TwoFields
.
objects
.
filter
(
f1__gte
=
450
,
f1__lte
=
550
)
.
count
(),
...
...
@@ -154,11 +152,10 @@ class BulkCreateTests(TestCase):
Test inserting a large batch with objects having primary key set
mixed together with objects without PK set.
"""
with
override_settings
(
DEBUG
=
True
):
connection
.
queries_log
.
clear
()
TwoFields
.
objects
.
bulk_create
([
TwoFields
(
id
=
i
if
i
%
2
==
0
else
None
,
f1
=
i
,
f2
=
i
+
1
)
for
i
in
range
(
100000
,
101000
)])
TwoFields
.
objects
.
bulk_create
([
TwoFields
(
id
=
i
if
i
%
2
==
0
else
None
,
f1
=
i
,
f2
=
i
+
1
)
for
i
in
range
(
100000
,
101000
)
])
self
.
assertEqual
(
TwoFields
.
objects
.
count
(),
1000
)
# We can't assume much about the ID's created, except that the above
# created IDs must exist.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment