mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
git-svn-id: http://code.djangoproject.com/svn/django/branches/gis@6394 bcc190cf-cafb-0310-a4f2-bffc1f526a37
26 lines
544 B
Python
26 lines
544 B
Python
"""
|
|
>>> from 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
|
|
>>> a = AnonymousUser()
|
|
>>> a.is_staff
|
|
False
|
|
>>> a.groups.all()
|
|
[]
|
|
>>> a.user_permissions.all()
|
|
[]
|
|
""" |