Commit 120b239c by Kevin McDermott

Change to an assert following a chat with James.

parent ef0a28fe
...@@ -79,8 +79,7 @@ if getattr(settings, 'OPENID_USE_AS_ADMIN_LOGIN', False): ...@@ -79,8 +79,7 @@ if getattr(settings, 'OPENID_USE_AS_ADMIN_LOGIN', False):
return views.default_render_failure( return views.default_render_failure(
request, "User %s does not have admin access." request, "User %s does not have admin access."
% request.user.username) % request.user.username)
return views.render_failure( assert "Unknown Error: %s" % error_message
request, "Unknown Error: %s" % error_message)
else: else:
# Redirect to openid login path, # Redirect to openid login path,
return HttpResponseRedirect( return HttpResponseRedirect(
......
...@@ -73,17 +73,6 @@ class SiteAdminTests(TestCase): ...@@ -73,17 +73,6 @@ class SiteAdminTests(TestCase):
self.assertTrue('User testing does not have admin access.' in self.assertTrue('User testing does not have admin access.' in
response.content, 'Missing error message in response') response.content, 'Missing error message in response')
def dont_admin_site_with_openid_login_authenticated_and_staff(self):
"""
If the request has an authenticated user, who is flagged as a
staff member, then they get a error response.
"""
create_user(is_staff=True)
self.client.login(username='testing', password='test')
response = self.client.get('/admin/')
self.assertTrue('Unknown Error: ' in
response.content, 'Missing error message in response')
def test_admin_site_with_openid_login_non_authenticated_user(self): def test_admin_site_with_openid_login_non_authenticated_user(self):
""" """
Unauthenticated users accessing the admin page should be directed to Unauthenticated users accessing the admin page should be directed to
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment