From fa21608801f8d2ef710d4c28abbb558883afeaf7 Mon Sep 17 00:00:00 2001 From: Tulio Casagrande Date: Mon, 20 Feb 2017 14:37:37 -0300 Subject: [#907] Translate auth error message on login with @anikarni --- service/test/integration/test_multi_user_login.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'service/test/integration/test_multi_user_login.py') diff --git a/service/test/integration/test_multi_user_login.py b/service/test/integration/test_multi_user_login.py index fe456583..b04a4e9e 100644 --- a/service/test/integration/test_multi_user_login.py +++ b/service/test/integration/test_multi_user_login.py @@ -13,7 +13,6 @@ # # You should have received a copy of the GNU Affero General Public License # along with Pixelated. If not, see . -from mock import patch from twisted.internet import defer @@ -47,8 +46,8 @@ class MultiUserLoginTest(MultiUserSoledadTestBase): self.assertEquals(val, response[key]) @defer.inlineCallbacks - def test_wrong_credentials_cannot_access_resources(self): + def test_wrong_credentials_is_redirected_to_login(self): response, login_request = self.app_test_client.login('username', 'wrong_password') - response_str = yield response - self.assertEqual(401, login_request.responseCode) - self.assertIn('Invalid username or password', login_request.written) + yield response + self.assertEqual(302, login_request.responseCode) + self.assertIn('/login?auth-error', login_request.uri) -- cgit v1.2.3 From 77916147760ffc6cea8242955a551ce75d8b29e4 Mon Sep 17 00:00:00 2001 From: Tulio Casagrande Date: Mon, 20 Feb 2017 16:15:29 -0300 Subject: [#907] Change auth-error url with @anikarni --- service/test/integration/test_multi_user_login.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'service/test/integration/test_multi_user_login.py') diff --git a/service/test/integration/test_multi_user_login.py b/service/test/integration/test_multi_user_login.py index b04a4e9e..04cceec3 100644 --- a/service/test/integration/test_multi_user_login.py +++ b/service/test/integration/test_multi_user_login.py @@ -50,4 +50,4 @@ class MultiUserLoginTest(MultiUserSoledadTestBase): response, login_request = self.app_test_client.login('username', 'wrong_password') yield response self.assertEqual(302, login_request.responseCode) - self.assertIn('/login?auth-error', login_request.uri) + self.assertIn('/login?auth-error', login_request.responseHeaders.getRawHeaders('location')) -- cgit v1.2.3