Changeset 5677
- Timestamp:
- 07/12/07 10:26:37 (1 year ago)
- Files:
-
- django/trunk/django/test/client.py (modified) (1 diff)
- django/trunk/tests/modeltests/test_client/fixtures/testdata.json (modified) (1 diff)
- django/trunk/tests/modeltests/test_client/models.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/test/client.py
r5609 r5677 226 226 227 227 Returns True if login is possible; False if the provided credentials 228 are incorrect, or if the Sessions framework is not available. 228 are incorrect, or the user is inactive, or if the Sessions framework is 229 not available. 229 230 """ 230 231 user = authenticate(**credentials) 231 if user and 'django.contrib.sessions' in settings.INSTALLED_APPS:232 if user and user.is_active and 'django.contrib.sessions' in settings.INSTALLED_APPS: 232 233 obj = Session.objects.get_new_session_object() 233 234 django/trunk/tests/modeltests/test_client/fixtures/testdata.json
r4659 r5677 17 17 "date_joined": "2006-12-17 07:03:31" 18 18 } 19 }, 20 { 21 "pk": "2", 22 "model": "auth.user", 23 "fields": { 24 "username": "inactive", 25 "first_name": "Inactive", 26 "last_name": "User", 27 "is_active": false, 28 "is_superuser": false, 29 "is_staff": false, 30 "last_login": "2006-12-17 07:03:31", 31 "groups": [], 32 "user_permissions": [], 33 "password": "sha1$6efc0$f93efe9fd7542f25a7be94871ea45aa95de57161", 34 "email": "testclient@example.com", 35 "date_joined": "2006-12-17 07:03:31" 36 } 19 37 } 20 38 ] django/trunk/tests/modeltests/test_client/models.py
r5609 r5677 229 229 self.failIf(login) 230 230 231 def test_view_with_inactive_login(self): 232 "Request a page that is protected with @login, but use an inactive login" 233 234 login = self.client.login(username='inactive', password='password') 235 self.failIf(login) 236 231 237 def test_session_modifying_view(self): 232 238 "Request a page that modifies the session"
