1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
|
Description: Adapt for change in admin login behaviour
OPENID_USE_AS_ADMIN_LOGIN no longer fails to an openid login
page with django1.7, despite openid working normally. Adapt the
test cases to suit.
Author: Neil Williams <codehelp@debian.org>
Bug-Debian: https://bugs.debian.org/755667
---
--- django-openid-auth-0.5.orig/django_openid_auth/tests/test_admin.py
+++ django-openid-auth-0.5/django_openid_auth/tests/test_admin.py
@@ -70,8 +70,9 @@ class SiteAdminTests(TestCase):
create_user()
self.client.login(username='testing', password='test')
response = self.client.get('/admin/')
- self.assertTrue('User testing does not have admin access.' in
- response.content, 'Missing error message in response')
+ self.assertEqual(302, response.status_code)
+ self.assertEqual('http://testserver/admin/login/?next=/admin/',
+ response['Location'])
def test_admin_site_with_openid_login_non_authenticated_user(self):
"""
@@ -80,7 +81,7 @@ class SiteAdminTests(TestCase):
"""
response = self.client.get('/admin/')
self.assertEqual(302, response.status_code)
- self.assertEqual('http://testserver/openid/login/?next=/admin/',
+ self.assertEqual('http://testserver/admin/login/?next=/admin/',
response['Location'])
|