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
8c356acf
Kaydet (Commit)
8c356acf
authored
Agu 16, 2012
tarafından
Aymeric Augustin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[py3] Fixed test_utils tests of doctests.
üst
688678e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
+19
-14
tests.py
tests/regressiontests/test_utils/tests.py
+19
-14
No files found.
tests/regressiontests/test_utils/tests.py
Dosyayı görüntüle @
8c356acf
...
...
@@ -5,6 +5,7 @@ from django.forms import EmailField, IntegerField
from
django.http
import
HttpResponse
from
django.template.loader
import
render_to_string
from
django.test
import
SimpleTestCase
,
TestCase
,
skipUnlessDBFeature
from
django.utils
import
six
from
django.utils.unittest
import
skip
from
.models
import
Person
...
...
@@ -495,12 +496,6 @@ __test__ = {"API_TEST": r"""
>>> from django.utils.xmlutils import SimplerXMLGenerator
>>> from django.utils.six import StringIO
>>> def produce_long():
... return 42L
>>> def produce_int():
... return 42
>>> def produce_json():
... return json.dumps(['foo', {'bar': ('baz', None, 1.0, 2), 'whiz': 42}])
...
...
@@ -529,14 +524,6 @@ __test__ = {"API_TEST": r"""
... xml.endElement("bar")
... return stream.getvalue()
# Long values are normalized and are comparable to normal integers ...
>>> produce_long()
42
# ... and vice versa
>>> produce_int()
42L
# JSON output is normalized for field order, so it doesn't matter
# which order json dictionary attributes are listed in output
>>> produce_json()
...
...
@@ -560,3 +547,21 @@ __test__ = {"API_TEST": r"""
'<foo bbb="2.0" aaa="1.0">Hello</foo><bar ddd="4.0" ccc="3.0"></bar>'
"""
}
if
not
six
.
PY3
:
__test__
[
"API_TEST"
]
+=
"""
>>> def produce_long():
... return 42L
>>> def produce_int():
... return 42
# Long values are normalized and are comparable to normal integers ...
>>> produce_long()
42
# ... and vice versa
>>> produce_int()
42L
"""
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