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
e0643cb6
Kaydet (Commit)
e0643cb6
authored
Agu 31, 2013
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Properly skipped yaml tests when not installed
üst
3e34005b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
tests.py
tests/serializers/tests.py
+12
-7
No files found.
tests/serializers/tests.py
Dosyayı görüntüle @
e0643cb6
...
@@ -5,6 +5,12 @@ import json
...
@@ -5,6 +5,12 @@ import json
from
datetime
import
datetime
from
datetime
import
datetime
import
unittest
import
unittest
from
xml.dom
import
minidom
from
xml.dom
import
minidom
try
:
import
yaml
HAS_YAML
=
True
except
ImportError
:
HAS_YAML
=
False
from
django.conf
import
settings
from
django.conf
import
settings
from
django.core
import
serializers
from
django.core
import
serializers
...
@@ -445,12 +451,9 @@ class JsonSerializerTransactionTestCase(SerializersTransactionTestBase, Transact
...
@@ -445,12 +451,9 @@ class JsonSerializerTransactionTestCase(SerializersTransactionTestBase, Transact
}
}
}]"""
}]"""
try
:
import
yaml
@unittest.skipUnless
(
HAS_YAML
,
"No yaml library detected"
)
except
ImportError
:
class
YamlSerializerTestCase
(
SerializersTestBase
,
TestCase
):
pass
else
:
class
YamlSerializerTestCase
(
SerializersTestBase
,
TestCase
):
serializer_name
=
"yaml"
serializer_name
=
"yaml"
fwd_ref_str
=
"""- fields:
fwd_ref_str
=
"""- fields:
headline: Forward references pose no problem
headline: Forward references pose no problem
...
@@ -509,7 +512,9 @@ else:
...
@@ -509,7 +512,9 @@ else:
ret_list
.
append
(
str
(
field_value
))
ret_list
.
append
(
str
(
field_value
))
return
ret_list
return
ret_list
class
YamlSerializerTransactionTestCase
(
SerializersTransactionTestBase
,
TransactionTestCase
):
@unittest.skipUnless
(
HAS_YAML
,
"No yaml library detected"
)
class
YamlSerializerTransactionTestCase
(
SerializersTransactionTestBase
,
TransactionTestCase
):
serializer_name
=
"yaml"
serializer_name
=
"yaml"
fwd_ref_str
=
"""- fields:
fwd_ref_str
=
"""- fields:
headline: Forward references pose no problem
headline: Forward references pose no problem
...
...
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