Fixed #14252 - django.contrib.flatpages unit tests assume default value for settings.LOGIN_URL

Thanks to pmclanahan for report and patch.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@13851 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Luke Plant 2010-09-13 23:09:56 +00:00
parent 6fb4f6e299
commit 86031bf59d
3 changed files with 9 additions and 0 deletions

View File

@ -23,10 +23,13 @@ class FlatpageCSRFTests(TestCase):
'templates' 'templates'
), ),
) )
self.old_LOGIN_URL = settings.LOGIN_URL
settings.LOGIN_URL = '/accounts/login/'
def tearDown(self): def tearDown(self):
settings.MIDDLEWARE_CLASSES = self.old_MIDDLEWARE_CLASSES settings.MIDDLEWARE_CLASSES = self.old_MIDDLEWARE_CLASSES
settings.TEMPLATE_DIRS = self.old_TEMPLATE_DIRS settings.TEMPLATE_DIRS = self.old_TEMPLATE_DIRS
settings.LOGIN_URL = self.old_LOGIN_URL
def test_view_flatpage(self): def test_view_flatpage(self):
"A flatpage can be served through a view, even when the middleware is in use" "A flatpage can be served through a view, even when the middleware is in use"

View File

@ -19,10 +19,13 @@ class FlatpageMiddlewareTests(TestCase):
'templates' 'templates'
), ),
) )
self.old_LOGIN_URL = settings.LOGIN_URL
settings.LOGIN_URL = '/accounts/login/'
def tearDown(self): def tearDown(self):
settings.MIDDLEWARE_CLASSES = self.old_MIDDLEWARE_CLASSES settings.MIDDLEWARE_CLASSES = self.old_MIDDLEWARE_CLASSES
settings.TEMPLATE_DIRS = self.old_TEMPLATE_DIRS settings.TEMPLATE_DIRS = self.old_TEMPLATE_DIRS
settings.LOGIN_URL = self.old_LOGIN_URL
def test_view_flatpage(self): def test_view_flatpage(self):
"A flatpage can be served through a view, even when the middleware is in use" "A flatpage can be served through a view, even when the middleware is in use"

View File

@ -20,10 +20,13 @@ class FlatpageViewTests(TestCase):
'templates' 'templates'
), ),
) )
self.old_LOGIN_URL = settings.LOGIN_URL
settings.LOGIN_URL = '/accounts/login/'
def tearDown(self): def tearDown(self):
settings.MIDDLEWARE_CLASSES = self.old_MIDDLEWARE_CLASSES settings.MIDDLEWARE_CLASSES = self.old_MIDDLEWARE_CLASSES
settings.TEMPLATE_DIRS = self.old_TEMPLATE_DIRS settings.TEMPLATE_DIRS = self.old_TEMPLATE_DIRS
settings.LOGIN_URL = self.old_LOGIN_URL
def test_view_flatpage(self): def test_view_flatpage(self):
"A flatpage can be served through a view" "A flatpage can be served through a view"