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
714161c8
Kaydet (Commit)
714161c8
authored
Nis 19, 2013
tarafından
Alex Gaynor
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix != operations on lazy objects.
üst
59d127e4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
functional.py
django/utils/functional.py
+1
-0
test_simplelazyobject.py
tests/utils_tests/test_simplelazyobject.py
+9
-0
No files found.
django/utils/functional.py
Dosyayı görüntüle @
714161c8
...
...
@@ -346,6 +346,7 @@ class SimpleLazyObject(LazyObject):
# care about this (especially in equality tests)
__class__
=
property
(
new_method_proxy
(
operator
.
attrgetter
(
"__class__"
)))
__eq__
=
new_method_proxy
(
operator
.
eq
)
__ne__
=
new_method_proxy
(
operator
.
ne
)
__hash__
=
new_method_proxy
(
hash
)
__bool__
=
new_method_proxy
(
bool
)
# Python 3
__nonzero__
=
__bool__
# Python 2
...
...
tests/utils_tests/test_simplelazyobject.py
Dosyayı görüntüle @
714161c8
...
...
@@ -152,3 +152,12 @@ class TestUtilsSimpleLazyObject(TestCase):
SimpleLazyObject
(
None
)
finally
:
sys
.
settrace
(
old_trace_func
)
def
test_not_equal
(
self
):
lazy1
=
SimpleLazyObject
(
lambda
:
2
)
lazy2
=
SimpleLazyObject
(
lambda
:
2
)
lazy3
=
SimpleLazyObject
(
lambda
:
3
)
self
.
assertEqual
(
lazy1
,
lazy2
)
self
.
assertNotEqual
(
lazy1
,
lazy3
)
self
.
assertTrue
(
lazy1
!=
lazy3
)
self
.
assertFalse
(
lazy1
!=
lazy2
)
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