From c8d39f15cbbd22cdfbeb877024df2b5afd5334d3 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Mon, 23 Jun 2008 12:17:57 +0000 Subject: [PATCH] Fixed #7521 -- Reverted [7716]. Fixed URLs in test case broke any application that deployed contrib.auth. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7726 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- .../contrib/auth/fixtures/authtestdata.json | 56 ------------------- django/contrib/auth/tests.py | 21 +------ django/contrib/auth/urls.py | 12 ---- tests/urls.py | 3 - 4 files changed, 2 insertions(+), 90 deletions(-) delete mode 100644 django/contrib/auth/fixtures/authtestdata.json delete mode 100644 django/contrib/auth/urls.py diff --git a/django/contrib/auth/fixtures/authtestdata.json b/django/contrib/auth/fixtures/authtestdata.json deleted file mode 100644 index e0bdc24e72..0000000000 --- a/django/contrib/auth/fixtures/authtestdata.json +++ /dev/null @@ -1,56 +0,0 @@ -[ - { - "pk": "1", - "model": "auth.user", - "fields": { - "username": "testclient", - "first_name": "Test", - "last_name": "Client", - "is_active": true, - "is_superuser": false, - "is_staff": false, - "last_login": "2006-12-17 07:03:31", - "groups": [], - "user_permissions": [], - "password": "sha1$6efc0$f93efe9fd7542f25a7be94871ea45aa95de57161", - "email": "testclient@example.com", - "date_joined": "2006-12-17 07:03:31" - } - }, - { - "pk": "2", - "model": "auth.user", - "fields": { - "username": "inactive", - "first_name": "Inactive", - "last_name": "User", - "is_active": false, - "is_superuser": false, - "is_staff": false, - "last_login": "2006-12-17 07:03:31", - "groups": [], - "user_permissions": [], - "password": "sha1$6efc0$f93efe9fd7542f25a7be94871ea45aa95de57161", - "email": "testclient@example.com", - "date_joined": "2006-12-17 07:03:31" - } - }, - { - "pk": "3", - "model": "auth.user", - "fields": { - "username": "staff", - "first_name": "Staff", - "last_name": "Member", - "is_active": true, - "is_superuser": false, - "is_staff": true, - "last_login": "2006-12-17 07:03:31", - "groups": [], - "user_permissions": [], - "password": "sha1$6efc0$f93efe9fd7542f25a7be94871ea45aa95de57161", - "email": "staffmember@example.com", - "date_joined": "2006-12-17 07:03:31" - } - } -] diff --git a/django/contrib/auth/tests.py b/django/contrib/auth/tests.py index e09f379456..81094ca85f 100644 --- a/django/contrib/auth/tests.py +++ b/django/contrib/auth/tests.py @@ -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) +""" \ No newline at end of file diff --git a/django/contrib/auth/urls.py b/django/contrib/auth/urls.py deleted file mode 100644 index 3fd7cb47ad..0000000000 --- a/django/contrib/auth/urls.py +++ /dev/null @@ -1,12 +0,0 @@ -# This exists for the sake of testing only. Normally URLs are mapped in -# ../admin/urls.py - -from django.conf.urls.defaults import * - -urlpatterns = patterns('', - ('^logout/$', 'django.contrib.auth.views.logout'), - ('^password_change/$', 'django.contrib.auth.views.password_change'), - ('^password_change/done/$', 'django.contrib.auth.views.password_change_done'), - ('^password_reset/$', 'django.contrib.auth.views.password_reset') -) - diff --git a/tests/urls.py b/tests/urls.py index a0ef892313..dbdf9a8064 100644 --- a/tests/urls.py +++ b/tests/urls.py @@ -22,7 +22,4 @@ urlpatterns = patterns('', # test urlconf for syndication tests (r'^syndication/', include('regressiontests.syndication.urls')), - - # Other contrib apps - (r'^auth/', include('django.contrib.auth.urls')), )