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
7ce9644d
Kaydet (Commit)
7ce9644d
authored
Ara 24, 2014
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added a test to ensure bad assignation to M2M doesn't clear data
Refs #14394.
üst
5dddd794
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
tests.py
tests/m2m_regress/tests.py
+12
-0
No files found.
tests/m2m_regress/tests.py
Dosyayı görüntüle @
7ce9644d
...
...
@@ -97,3 +97,15 @@ class M2MRegressionTests(TestCase):
# causes a TypeError in add_lazy_relation
m1
=
RegressionModelSplit
(
name
=
'1'
)
m1
.
save
()
def
test_assigning_invalid_data_to_m2m_doesnt_clear_existing_relations
(
self
):
t1
=
Tag
.
objects
.
create
(
name
=
't1'
)
t2
=
Tag
.
objects
.
create
(
name
=
't2'
)
c1
=
TagCollection
.
objects
.
create
(
name
=
'c1'
)
c1
.
tags
=
[
t1
,
t2
]
with
self
.
assertRaises
(
TypeError
):
c1
.
tags
=
7
c1
.
refresh_from_db
()
self
.
assertQuerysetEqual
(
c1
.
tags
.
order_by
(
'name'
),
[
"<Tag: t1>"
,
"<Tag: t2>"
])
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