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
adb791fd
Kaydet (Commit)
adb791fd
authored
Ara 14, 2016
tarafından
Morgan Aubert
Kaydeden (comit)
Tim Graham
Ara 14, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Moved test_field_ordering to the model_fields package.
üst
92c5eeac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
17 deletions
+10
-17
tests.py
tests/basic/tests.py
+0
-17
tests.py
tests/model_fields/tests.py
+10
-0
No files found.
tests/basic/tests.py
Dosyayı görüntüle @
adb791fd
...
...
@@ -5,7 +5,6 @@ from datetime import datetime, timedelta
from
django.core.exceptions
import
MultipleObjectsReturned
,
ObjectDoesNotExist
from
django.db
import
DEFAULT_DB_ALIAS
,
DatabaseError
,
connections
from
django.db.models.fields
import
Field
from
django.db.models.manager
import
BaseManager
from
django.db.models.query
import
EmptyQuerySet
,
QuerySet
from
django.test
import
(
...
...
@@ -268,22 +267,6 @@ class ModelTest(TestCase):
s
=
{
a10
,
a11
,
a12
}
self
.
assertIn
(
Article
.
objects
.
get
(
headline
=
'Article 11'
),
s
)
def
test_field_ordering
(
self
):
"""
Field instances have a `__lt__` comparison function to define an
ordering based on their creation. Prior to #17851 this ordering
comparison relied on the now unsupported `__cmp__` and was assuming
compared objects were both Field instances raising `AttributeError`
when it should have returned `NotImplemented`.
"""
f1
=
Field
()
f2
=
Field
(
auto_created
=
True
)
f3
=
Field
()
self
.
assertLess
(
f2
,
f1
)
self
.
assertGreater
(
f3
,
f1
)
self
.
assertIsNotNone
(
f1
)
self
.
assertNotIn
(
f2
,
(
None
,
1
,
''
))
def
test_extra_method_select_argument_with_dashes_and_values
(
self
):
# The 'select' argument to extra() supports names with dashes in
# them, as long as you use values().
...
...
tests/model_fields/tests.py
Dosyayı görüntüle @
adb791fd
...
...
@@ -59,6 +59,16 @@ class BasicFieldTests(TestCase):
f
=
Foo
.
_meta
.
get_field
(
'a'
)
self
.
assertEqual
(
force_str
(
f
),
'model_fields.Foo.a'
)
def
test_field_ordering
(
self
):
"""Fields are ordered based on their creation."""
f1
=
models
.
Field
()
f2
=
models
.
Field
(
auto_created
=
True
)
f3
=
models
.
Field
()
self
.
assertLess
(
f2
,
f1
)
self
.
assertGreater
(
f3
,
f1
)
self
.
assertIsNotNone
(
f1
)
self
.
assertNotIn
(
f2
,
(
None
,
1
,
''
))
class
ChoicesTests
(
SimpleTestCase
):
...
...
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