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
5627057f
Kaydet (Commit)
5627057f
authored
Nis 28, 2019
tarafından
Jon Dufresne
Kaydeden (comit)
Mariusz Felisiak
Nis 29, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Refs #26022 -- Used context manager version of assertRaisesMessage in tests.
Follow up to
253adc2b
.
üst
dbe436a9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
tests.py
tests/dates/tests.py
+3
-5
tests.py
tests/m2m_regress/tests.py
+3
-3
tests.py
tests/test_utils/tests.py
+4
-2
No files found.
tests/dates/tests.py
Dosyayı görüntüle @
5627057f
...
@@ -89,14 +89,12 @@ class DatesTests(TestCase):
...
@@ -89,14 +89,12 @@ class DatesTests(TestCase):
Article
.
objects
.
dates
()
Article
.
objects
.
dates
()
def
test_dates_fails_when_given_invalid_field_argument
(
self
):
def
test_dates_fails_when_given_invalid_field_argument
(
self
):
self
.
assertRaisesMessage
(
with
self
.
assertRaisesMessage
(
FieldError
,
FieldError
,
"Cannot resolve keyword 'invalid_field' into field. Choices are: "
"Cannot resolve keyword 'invalid_field' into field. Choices are: "
"categories, comments, id, pub_date, pub_datetime, title"
,
"categories, comments, id, pub_date, pub_datetime, title"
,
Article
.
objects
.
dates
,
):
"invalid_field"
,
Article
.
objects
.
dates
(
'invalid_field'
,
'year'
)
"year"
,
)
def
test_dates_fails_when_given_invalid_kind_argument
(
self
):
def
test_dates_fails_when_given_invalid_kind_argument
(
self
):
msg
=
"'kind' must be one of 'year', 'month', 'week', or 'day'."
msg
=
"'kind' must be one of 'year', 'month', 'week', or 'day'."
...
...
tests/m2m_regress/tests.py
Dosyayı görüntüle @
5627057f
...
@@ -34,11 +34,11 @@ class M2MRegressionTests(TestCase):
...
@@ -34,11 +34,11 @@ class M2MRegressionTests(TestCase):
def
test_internal_related_name_not_in_error_msg
(
self
):
def
test_internal_related_name_not_in_error_msg
(
self
):
# The secret internal related names for self-referential many-to-many
# The secret internal related names for self-referential many-to-many
# fields shouldn't appear in the list when an error is made.
# fields shouldn't appear in the list when an error is made.
self
.
assertRaisesMessage
(
with
self
.
assertRaisesMessage
(
FieldError
,
FieldError
,
"Choices are: id, name, references, related, selfreferchild, selfreferchildsibling"
,
"Choices are: id, name, references, related, selfreferchild, selfreferchildsibling"
,
lambda
:
SelfRefer
.
objects
.
filter
(
porcupine
=
'fred'
)
):
)
SelfRefer
.
objects
.
filter
(
porcupine
=
'fred'
)
def
test_m2m_inheritance_symmetry
(
self
):
def
test_m2m_inheritance_symmetry
(
self
):
# Test to ensure that the relationship between two inherited models
# Test to ensure that the relationship between two inherited models
...
...
tests/test_utils/tests.py
Dosyayı görüntüle @
5627057f
...
@@ -32,9 +32,11 @@ class SkippingTestCase(SimpleTestCase):
...
@@ -32,9 +32,11 @@ class SkippingTestCase(SimpleTestCase):
def
_assert_skipping
(
self
,
func
,
expected_exc
,
msg
=
None
):
def
_assert_skipping
(
self
,
func
,
expected_exc
,
msg
=
None
):
try
:
try
:
if
msg
is
not
None
:
if
msg
is
not
None
:
self
.
assertRaisesMessage
(
expected_exc
,
msg
,
func
)
with
self
.
assertRaisesMessage
(
expected_exc
,
msg
):
func
()
else
:
else
:
self
.
assertRaises
(
expected_exc
,
func
)
with
self
.
assertRaises
(
expected_exc
):
func
()
except
unittest
.
SkipTest
:
except
unittest
.
SkipTest
:
self
.
fail
(
'
%
s should not result in a skipped test.'
%
func
.
__name__
)
self
.
fail
(
'
%
s should not result in a skipped test.'
%
func
.
__name__
)
...
...
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