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
13857b45
Kaydet (Commit)
13857b45
authored
Agu 18, 2016
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removed unused 'password' parameter in auth_tests.
üst
39f35d4b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
test_views.py
tests/auth_tests/test_views.py
+8
-8
No files found.
tests/auth_tests/test_views.py
Dosyayı görüntüle @
13857b45
...
...
@@ -385,10 +385,10 @@ class UUIDUserPasswordResetTest(CustomUserPasswordResetTest):
class
ChangePasswordTest
(
AuthViewsTestCase
):
def
fail_login
(
self
,
password
=
'password'
):
def
fail_login
(
self
):
response
=
self
.
client
.
post
(
'/login/'
,
{
'username'
:
'testclient'
,
'password'
:
password
,
'password'
:
'password'
,
})
self
.
assertFormError
(
response
,
AuthenticationForm
.
error_messages
[
'invalid_login'
]
%
{
'username'
:
User
.
_meta
.
get_field
(
'username'
)
.
verbose_name
...
...
@@ -505,7 +505,7 @@ class LoginTest(AuthViewsTestCase):
self
.
assertIsInstance
(
response
.
context
[
'site'
],
RequestSite
)
self
.
assertIsInstance
(
response
.
context
[
'form'
],
AuthenticationForm
)
def
test_security_check
(
self
,
password
=
'password'
):
def
test_security_check
(
self
):
login_url
=
reverse
(
'login'
)
# Those URLs should not pass the security check
...
...
@@ -524,7 +524,7 @@ class LoginTest(AuthViewsTestCase):
}
response
=
self
.
client
.
post
(
nasty_url
,
{
'username'
:
'testclient'
,
'password'
:
password
,
'password'
:
'password'
,
})
self
.
assertEqual
(
response
.
status_code
,
302
)
self
.
assertNotIn
(
bad_url
,
response
.
url
,
...
...
@@ -546,7 +546,7 @@ class LoginTest(AuthViewsTestCase):
}
response
=
self
.
client
.
post
(
safe_url
,
{
'username'
:
'testclient'
,
'password'
:
password
,
'password'
:
'password'
,
})
self
.
assertEqual
(
response
.
status_code
,
302
)
self
.
assertIn
(
good_url
,
response
.
url
,
"
%
s should be allowed"
%
good_url
)
...
...
@@ -560,7 +560,7 @@ class LoginTest(AuthViewsTestCase):
# the custom authentication form used by this login asserts
# that a request is passed to the form successfully.
def
test_login_csrf_rotate
(
self
,
password
=
'password'
):
def
test_login_csrf_rotate
(
self
):
"""
Makes sure that a login rotates the currently-used CSRF token.
"""
...
...
@@ -579,7 +579,7 @@ class LoginTest(AuthViewsTestCase):
req
=
HttpRequest
()
req
.
COOKIES
[
settings
.
CSRF_COOKIE_NAME
]
=
token1
req
.
method
=
"POST"
req
.
POST
=
{
'username'
:
'testclient'
,
'password'
:
password
,
'csrfmiddlewaretoken'
:
token1
}
req
.
POST
=
{
'username'
:
'testclient'
,
'password'
:
'password'
,
'csrfmiddlewaretoken'
:
token1
}
# Use POST request to log in
SessionMiddleware
()
.
process_request
(
req
)
...
...
@@ -876,7 +876,7 @@ class LogoutTest(AuthViewsTestCase):
self
.
assertURLEqual
(
response
.
url
,
'/password_reset/'
)
self
.
confirm_logged_out
()
def
test_security_check
(
self
,
password
=
'password'
):
def
test_security_check
(
self
):
logout_url
=
reverse
(
'logout'
)
# Those URLs should not pass the security check
...
...
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