Django

Code

Changeset 7726

Show
Ignore:
Timestamp:
06/23/08 07:17:57 (3 months ago)
Author:
russellm
Message:

Fixed #7521 -- Reverted [7716]. Fixed URLs in test case broke any application that deployed contrib.auth.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/contrib/auth/tests.py

    r7716 r7726  
    11""" 
    2 >>> from django.contrib.auth.models import User, AnonymousUser 
     2>>> from models import User, AnonymousUser 
    33>>> u = User.objects.create_user('testuser', 'test@example.com', 'testpw') 
    44>>> u.has_usable_password() 
     
    5454u'!' 
    5555""" 
    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

    r7716 r7726  
    2323    # test urlconf for syndication tests 
    2424    (r'^syndication/', include('regressiontests.syndication.urls')), 
    25  
    26     # Other contrib apps 
    27     (r'^auth/', include('django.contrib.auth.urls')), 
    2825)