diff options
| author | Brian Rosner <brosner@gmail.com> | 2008-03-03 20:37:41 +0000 |
|---|---|---|
| committer | Brian Rosner <brosner@gmail.com> | 2008-03-03 20:37:41 +0000 |
| commit | ba2d0feb72c5df4f72b92a3ccf39436f6fbdaee3 (patch) | |
| tree | 291126f0689ac65722c7169ae2dbcb57c8b3d36d /django/contrib/auth/tests/basic.py | |
| parent | 61b9c8fe005d6d2a5a907b4402ce09b4b8153dad (diff) | |
newforms-admin: Fixed #6083 -- Updated django.contrib.auth to use newforms. A big thanks to Greg Turner, Michael Newman and Petr Marhoun.
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@7191 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/contrib/auth/tests/basic.py')
| -rw-r--r-- | django/contrib/auth/tests/basic.py | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/django/contrib/auth/tests/basic.py b/django/contrib/auth/tests/basic.py new file mode 100644 index 0000000000..950815e791 --- /dev/null +++ b/django/contrib/auth/tests/basic.py @@ -0,0 +1,39 @@ + +BASIC_TESTS = """ +>>> from django.contrib.auth.models import User, AnonymousUser +>>> u = User.objects.create_user('testuser', 'test@example.com', 'testpw') +>>> u.has_usable_password() +True +>>> u.check_password('bad') +False +>>> u.check_password('testpw') +True +>>> u.set_unusable_password() +>>> u.save() +>>> u.check_password('testpw') +False +>>> u.has_usable_password() +False +>>> u2 = User.objects.create_user('testuser2', 'test2@example.com') +>>> u2.has_usable_password() +False + +>>> u.is_authenticated() +True +>>> u.is_staff +False +>>> u.is_active +True + +>>> a = AnonymousUser() +>>> a.is_authenticated() +False +>>> a.is_staff +False +>>> a.is_active +False +>>> a.groups.all() +[] +>>> a.user_permissions.all() +[] +"""
\ No newline at end of file |
