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
e01b5a58
Kaydet (Commit)
e01b5a58
authored
Haz 18, 2013
tarafından
Anssi Kääriäinen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #11521 -- usage of field.attname in .update()
Fixed already by previous patch, only test added.
üst
c21e86ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
tests.py
tests/update/tests.py
+11
-2
No files found.
tests/update/tests.py
Dosyayı görüntüle @
e01b5a58
...
...
@@ -2,7 +2,7 @@ from __future__ import unicode_literals
from
django.test
import
TestCase
from
.models
import
A
,
B
,
C
,
D
,
DataPoint
,
RelatedPoint
from
.models
import
A
,
B
,
D
,
DataPoint
,
RelatedPoint
class
SimpleTest
(
TestCase
):
...
...
@@ -51,6 +51,15 @@ class SimpleTest(TestCase):
cnt
=
D
.
objects
.
filter
(
y
=
100
)
.
count
()
self
.
assertEqual
(
cnt
,
0
)
def
test_foreign_key_update_with_id
(
self
):
"""
Test that update works using <field>_id for foreign keys
"""
num_updated
=
self
.
a1
.
d_set
.
update
(
a_id
=
self
.
a2
)
self
.
assertEqual
(
num_updated
,
20
)
self
.
assertEqual
(
self
.
a2
.
d_set
.
count
(),
20
)
class
AdvancedTests
(
TestCase
):
def
setUp
(
self
):
...
...
@@ -115,4 +124,4 @@ class AdvancedTests(TestCase):
"""
method
=
DataPoint
.
objects
.
all
()[:
2
]
.
update
self
.
assertRaises
(
AssertionError
,
method
,
another_value
=
'another thing'
)
another_value
=
'another thing'
)
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