Changeset 7716
- Timestamp:
- 06/20/08 12:43:12 (3 months ago)
- Files:
-
- django/trunk/django/contrib/auth/fixtures (added)
- django/trunk/django/contrib/auth/fixtures/authtestdata.json (added)
- django/trunk/django/contrib/auth/tests.py (modified) (2 diffs)
- django/trunk/django/contrib/auth/urls.py (added)
- django/trunk/tests/urls.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/trunk/django/contrib/auth/tests.py
r7590 r7716 1 1 """ 2 >>> from models import User, AnonymousUser2 >>> from django.contrib.auth.models import User, AnonymousUser 3 3 >>> u = User.objects.create_user('testuser', 'test@example.com', 'testpw') 4 4 >>> u.has_usable_password() … … 54 54 u'!' 55 55 """ 56 57 from django.test import TestCase 58 from django.core import mail 59 60 class PasswordResetTest(TestCase): 61 fixtures = ['authtestdata.json'] 62 def test_email_not_found(self): 63 response = self.client.get('/auth/password_reset/') 64 self.assertEquals(response.status_code, 200) 65 response = self.client.post('/auth/password_reset/', {'email': 'not_a_real_email@email.com'} ) 66 self.assertContains(response, "That e-mail address doesn't have an associated user account") 67 self.assertEquals(len(mail.outbox), 0) 68 69 def test_email_found(self): 70 response = self.client.post('/auth/password_reset/', {'email': 'staffmember@example.com'} ) 71 self.assertEquals(response.status_code, 302) 72 self.assertEquals(len(mail.outbox), 1) django/trunk/tests/urls.py
r7328 r7716 23 23 # test urlconf for syndication tests 24 24 (r'^syndication/', include('regressiontests.syndication.urls')), 25 26 # Other contrib apps 27 (r'^auth/', include('django.contrib.auth.urls')), 25 28 )
