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
3e72f4b7
Kaydet (Commit)
3e72f4b7
authored
Eyl 28, 2017
tarafından
Mads Jensen
Kaydeden (comit)
Tim Graham
Eyl 29, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Completed test coverage for BasePasswordHasher.
üst
776f6902
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
test_hashers.py
tests/auth_tests/test_hashers.py
+29
-0
No files found.
tests/auth_tests/test_hashers.py
Dosyayı görüntüle @
3e72f4b7
...
...
@@ -431,6 +431,8 @@ class TestUtilsHashPass(SimpleTestCase):
class
BasePasswordHasherTests
(
SimpleTestCase
):
not_implemented_msg
=
'subclasses of BasePasswordHasher must provide
%
s() method'
def
setUp
(
self
):
self
.
hasher
=
BasePasswordHasher
()
...
...
@@ -445,6 +447,33 @@ class BasePasswordHasherTests(SimpleTestCase):
with
self
.
assertRaisesMessage
(
ValueError
,
msg
):
PlainHasher
()
.
_load_library
()
def
test_attributes
(
self
):
self
.
assertIsNone
(
self
.
hasher
.
algorithm
)
self
.
assertIsNone
(
self
.
hasher
.
library
)
def
test_encode
(
self
):
msg
=
self
.
not_implemented_msg
%
'an encode'
with
self
.
assertRaisesMessage
(
NotImplementedError
,
msg
):
self
.
hasher
.
encode
(
'password'
,
'salt'
)
def
test_harden_runtime
(
self
):
msg
=
'subclasses of BasePasswordHasher should provide a harden_runtime() method'
with
self
.
assertWarns
(
Warning
,
msg
=
msg
):
self
.
hasher
.
harden_runtime
(
'password'
,
'encoded'
)
def
test_must_update
(
self
):
self
.
assertIs
(
self
.
hasher
.
must_update
(
'encoded'
),
False
)
def
test_safe_summary
(
self
):
msg
=
self
.
not_implemented_msg
%
'a safe_summary'
with
self
.
assertRaisesMessage
(
NotImplementedError
,
msg
):
self
.
hasher
.
safe_summary
(
'encoded'
)
def
test_verify
(
self
):
msg
=
self
.
not_implemented_msg
%
'a verify'
with
self
.
assertRaisesMessage
(
NotImplementedError
,
msg
):
self
.
hasher
.
verify
(
'password'
,
'encoded'
)
@skipUnless
(
argon2
,
"argon2-cffi not installed"
)
@override_settings
(
PASSWORD_HASHERS
=
PASSWORD_HASHERS
)
...
...
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