1 | # Tests of check_password function
|
---|
2 |
|
---|
3 | """
|
---|
4 | >>> from django.contrib.auth.models import check_password
|
---|
5 |
|
---|
6 | >>> check_password('hello', 'sha1$b58c0$6ab58c27e867939bea0557555de0a4dad2e6450b')
|
---|
7 | True
|
---|
8 | >>> check_password('hallo', 'sha1$b58c0$6ab58c27e867939bea0557555de0a4dad2e6450b')
|
---|
9 | False
|
---|
10 | >>> check_password('hello', 'sha256$b58c0$6ab58c27e867939bea0557555de0a4dad2e6450b')
|
---|
11 | False
|
---|
12 | >>> check_password('hello', 'sha1$c58c0$6ab58c27e867939bea0557555de0a4dad2e6450b')
|
---|
13 | False
|
---|
14 | >>> check_password('hello', 'sha1$b58c0$7ab58c27e867939bea0557555de0a4dad2e6450b')
|
---|
15 | False
|
---|
16 |
|
---|
17 | >>> check_password('hello', 'sha256$b58c0$6ee3346be81c210d176fa4e1618fb354c3bfe00203e553be15f3234ed1d79479')
|
---|
18 | True
|
---|
19 | >>> check_password('hallo', 'sha256$b58c0$6ee3346be81c210d176fa4e1618fb354c3bfe00203e553be15f3234ed1d79479')
|
---|
20 | False
|
---|
21 | >>> check_password('hello', 'sha1$b58c0$6ee3346be81c210d176fa4e1618fb354c3bfe00203e553be15f3234ed1d79479')
|
---|
22 | False
|
---|
23 | >>> check_password('hello', 'sha256$c58c0$6ee3346be81c210d176fa4e1618fb354c3bfe00203e553be15f3234ed1d79479')
|
---|
24 | False
|
---|
25 | >>> check_password('hello', 'sha256$b58c0$7ee3346be81c210d176fa4e1618fb354c3bfe00203e553be15f3234ed1d79479')
|
---|
26 | False
|
---|
27 |
|
---|
28 | >>> check_password('hello', 'sha224$b58c0$2eeb852c7a6e590a0fd61602e382457fea74c33961ca15c8d480a80d')
|
---|
29 | True
|
---|
30 | >>> check_password('hello', 'sha384$b58c0$a9cc26418db64c0b1bf77ac2ad8110108b2998fd1c628eb7c625d0b9fdb7e97fd944c126a290c948167ed3346fba5373')
|
---|
31 | True
|
---|
32 | """
|
---|