Skip to content

Commit

Permalink
[1.2.X] Fixed #14252 - django.contrib.flatpages unit tests assume def…
Browse files Browse the repository at this point in the history
…ault value for settings.LOGIN_URL

Thanks to pmclanahan for report and patch.

Backport of [13851] from trunk

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.2.X@13853 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
spookylukey committed Sep 13, 2010
1 parent 759625c commit 238eea4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions django/contrib/flatpages/tests/csrf.py
Expand Up @@ -22,10 +22,13 @@ def setUp(self):
'templates'
),
)
self.old_LOGIN_URL = settings.LOGIN_URL
settings.LOGIN_URL = '/accounts/login/'

def tearDown(self):
settings.MIDDLEWARE_CLASSES = self.old_MIDDLEWARE_CLASSES
settings.TEMPLATE_DIRS = self.old_TEMPLATE_DIRS
settings.LOGIN_URL = self.old_LOGIN_URL

def test_view_flatpage(self):
"A flatpage can be served through a view, even when the middleware is in use"
Expand Down
3 changes: 3 additions & 0 deletions django/contrib/flatpages/tests/middleware.py
Expand Up @@ -18,10 +18,13 @@ def setUp(self):
'templates'
),
)
self.old_LOGIN_URL = settings.LOGIN_URL
settings.LOGIN_URL = '/accounts/login/'

def tearDown(self):
settings.MIDDLEWARE_CLASSES = self.old_MIDDLEWARE_CLASSES
settings.TEMPLATE_DIRS = self.old_TEMPLATE_DIRS
settings.LOGIN_URL = self.old_LOGIN_URL

def test_view_flatpage(self):
"A flatpage can be served through a view, even when the middleware is in use"
Expand Down
3 changes: 3 additions & 0 deletions django/contrib/flatpages/tests/views.py
Expand Up @@ -18,10 +18,13 @@ def setUp(self):
'templates'
),
)
self.old_LOGIN_URL = settings.LOGIN_URL
settings.LOGIN_URL = '/accounts/login/'

def tearDown(self):
settings.MIDDLEWARE_CLASSES = self.old_MIDDLEWARE_CLASSES
settings.TEMPLATE_DIRS = self.old_TEMPLATE_DIRS
settings.LOGIN_URL = self.old_LOGIN_URL

def test_view_flatpage(self):
"A flatpage can be served through a view"
Expand Down

0 comments on commit 238eea4

Please sign in to comment.