diff options
author | 2013-09-16 20:19:11 +0200 | |
---|---|---|
committer | 2013-09-22 11:03:21 +0200 | |
commit | 105e5adbb7831442c9925aa812f711a9f020dfa4 (patch) | |
tree | 5f801e39924fed7011486216a81e870e89c04649 | |
parent | Replace django-auth-ldap with ldapdb-based auth backend. (diff) | |
download | identity.gentoo.org-105e5adbb7831442c9925aa812f711a9f020dfa4.tar.gz identity.gentoo.org-105e5adbb7831442c9925aa812f711a9f020dfa4.tar.bz2 identity.gentoo.org-105e5adbb7831442c9925aa812f711a9f020dfa4.zip |
Fix login tests for proper handling of LDAP exceptions.
-rw-r--r-- | okupy/tests/unit/test_login.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/okupy/tests/unit/test_login.py b/okupy/tests/unit/test_login.py index f781741..424e8be 100644 --- a/okupy/tests/unit/test_login.py +++ b/okupy/tests/unit/test_login.py @@ -144,17 +144,20 @@ class LoginUnitTestsNoLDAP(OkupyTestCase): self.assertMessage(response, 'Login failed', 40) def test_dont_authenticate_from_db_when_ldap_is_down(self): - request = set_request(uri='/login', post=vars.LOGIN_BOB, messages=True) + request = set_request(uri='/login', post=vars.LOGIN_BOB, + messages=True) response = login(request) response.context = RequestContext(request) - self.assertMessage(response, 'Login failed', 40) + self.assertMessage(response, + "Can't contact the LDAP server or the database", 40) - def test_no_ldap_connection_raises_login_failed_in_login(self): + def test_no_ldap_connection_raises_ldaperror_in_login(self): request = set_request(uri='/login', post=vars.LOGIN_WRONG, messages=True) response = login(request) response.context = RequestContext(request) - self.assertMessage(response, 'Login failed', 40) + self.assertMessage(response, + "Can't contact the LDAP server or the database", 40) def test_no_ldap_connection_in_logout_sends_notification_mail(self): request = set_request(uri='/login', post=vars.LOGIN_ALICE, |