|
@@ -1,5 +1,5 @@
|
|
|
"""
|
|
|
->>> from django.contrib.auth.models import User, AnonymousUser
|
|
|
+>>> from models import User, AnonymousUser
|
|
|
>>> u = User.objects.create_user('testuser', 'test@example.com', 'testpw')
|
|
|
>>> u.has_usable_password()
|
|
|
True
|
|
@@ -52,21 +52,4 @@ Superuser created successfully.
|
|
|
u'joe@somewhere.org'
|
|
|
>>> u.password
|
|
|
u'!'
|
|
|
-"""
|
|
|
-
|
|
|
-from django.test import TestCase
|
|
|
-from django.core import mail
|
|
|
-
|
|
|
-class PasswordResetTest(TestCase):
|
|
|
- fixtures = ['authtestdata.json']
|
|
|
- def test_email_not_found(self):
|
|
|
- response = self.client.get('/auth/password_reset/')
|
|
|
- self.assertEquals(response.status_code, 200)
|
|
|
- response = self.client.post('/auth/password_reset/', {'email': 'not_a_real_email@email.com'} )
|
|
|
- self.assertContains(response, "That e-mail address doesn't have an associated user account")
|
|
|
- self.assertEquals(len(mail.outbox), 0)
|
|
|
-
|
|
|
- def test_email_found(self):
|
|
|
- response = self.client.post('/auth/password_reset/', {'email': 'staffmember@example.com'} )
|
|
|
- self.assertEquals(response.status_code, 302)
|
|
|
- self.assertEquals(len(mail.outbox), 1)
|
|
|
+"""
|