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
95b7699f
Kaydet (Commit)
95b7699f
authored
Mar 15, 2019
tarafından
Jon Dufresne
Kaydeden (comit)
Tim Graham
Mar 15, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Cleaned up exception message checking in some tests.
üst
58ad030d
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
9 deletions
+15
-9
test_views.py
tests/auth_tests/test_views.py
+1
-1
tests.py
tests/file_uploads/tests.py
+2
-2
tests.py
tests/many_to_many/tests.py
+2
-1
tests.py
tests/test_client/tests.py
+2
-1
tests.py
tests/urlpatterns_reverse/tests.py
+7
-3
test_autoreload.py
tests/utils_tests/test_autoreload.py
+1
-1
No files found.
tests/auth_tests/test_views.py
Dosyayı görüntüle @
95b7699f
...
...
@@ -854,7 +854,7 @@ class LoginRedirectAuthenticatedUser(AuthViewsTestCase):
self
.
login
()
msg
=
(
"Redirection loop for authenticated user detected. Check that "
"your LOGIN_REDIRECT_URL doesn't point to a login page"
"your LOGIN_REDIRECT_URL doesn't point to a login page
.
"
)
with
self
.
settings
(
LOGIN_REDIRECT_URL
=
self
.
do_redirect_url
):
with
self
.
assertRaisesMessage
(
ValueError
,
msg
):
...
...
tests/file_uploads/tests.py
Dosyayı görüntüle @
95b7699f
...
...
@@ -385,8 +385,8 @@ class FileUploadTests(TestCase):
file
.
write
(
b
'a'
*
(
2
**
21
))
file
.
seek
(
0
)
# AttributeError: You cannot alter upload handlers after the upload has been processed.
with
self
.
assertRaises
(
AttributeError
):
msg
=
'You cannot alter upload handlers after the upload has been processed.'
with
self
.
assertRaises
Message
(
AttributeError
,
msg
):
self
.
client
.
post
(
'/quota/broken/'
,
{
'f'
:
file
})
def
test_fileupload_getlist
(
self
):
...
...
tests/many_to_many/tests.py
Dosyayı görüntüle @
95b7699f
...
...
@@ -63,7 +63,8 @@ class ManyToManyTests(TestCase):
)
# Adding an object of the wrong type raises TypeError
with
self
.
assertRaisesMessage
(
TypeError
,
"'Publication' instance expected, got <Article"
):
msg
=
"'Publication' instance expected, got <Article: Django lets you create Web apps easily>"
with
self
.
assertRaisesMessage
(
TypeError
,
msg
):
with
transaction
.
atomic
():
a6
.
publications
.
add
(
a5
)
...
...
tests/test_client/tests.py
Dosyayı görüntüle @
95b7699f
...
...
@@ -829,8 +829,9 @@ class ClientTest(TestCase):
def
test_response_raises_multi_arg_exception
(
self
):
"""A request may raise an exception with more than one required arg."""
with
self
.
assertRaises
(
TwoArgException
):
with
self
.
assertRaises
(
TwoArgException
)
as
cm
:
self
.
client
.
get
(
'/two_arg_exception/'
)
self
.
assertEqual
(
cm
.
exception
.
args
,
(
'one'
,
'two'
))
def
test_uploading_temp_file
(
self
):
with
tempfile
.
TemporaryFile
()
as
test_file
:
...
...
tests/urlpatterns_reverse/tests.py
Dosyayı görüntüle @
95b7699f
...
...
@@ -997,8 +997,11 @@ class RequestURLconfTests(SimpleTestCase):
Test reversing an URL from the *default* URLconf from inside
a response middleware.
"""
message
=
"Reverse for 'outer' not found."
with
self
.
assertRaisesMessage
(
NoReverseMatch
,
message
):
msg
=
(
"Reverse for 'outer' not found. 'outer' is not a valid view "
"function or pattern name."
)
with
self
.
assertRaisesMessage
(
NoReverseMatch
,
msg
):
self
.
client
.
get
(
'/second_test/'
)
@override_settings
(
...
...
@@ -1070,7 +1073,8 @@ class DefaultErrorHandlerTests(SimpleTestCase):
response
=
self
.
client
.
get
(
'/test/'
)
self
.
assertEqual
(
response
.
status_code
,
404
)
with
self
.
assertRaisesMessage
(
ValueError
,
"I don't think I'm getting good"
):
msg
=
"I don't think I'm getting good value for this view"
with
self
.
assertRaisesMessage
(
ValueError
,
msg
):
self
.
client
.
get
(
'/bad_view/'
)
...
...
tests/utils_tests/test_autoreload.py
Dosyayı görüntüle @
95b7699f
...
...
@@ -286,7 +286,7 @@ class TestRaiseLastException(SimpleTestCase):
exc_info
=
sys
.
exc_info
()
with
mock
.
patch
(
'django.utils.autoreload._exception'
,
exc_info
):
with
self
.
assertRaises
(
MyException
,
msg
=
'Test Message'
):
with
self
.
assertRaises
Message
(
MyException
,
'Test Message'
):
autoreload
.
raise_last_exception
()
...
...
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