diff options
author | NavaL <mnandri@thoughtworks.com> | 2016-02-25 09:16:28 +0100 |
---|---|---|
committer | NavaL <mnandri@thoughtworks.com> | 2016-02-25 09:43:02 +0100 |
commit | 1e1668f98afd04e2da7c779a825e6d28e777fec7 (patch) | |
tree | 3083f6e70f1e3ae004326ff2ece87a768794c40a /service/test/unit | |
parent | 9573bdca55ddc5488066d3af525e41ed1d872ea6 (diff) |
changed logout to post
Issue #612
Diffstat (limited to 'service/test/unit')
-rw-r--r-- | service/test/unit/resources/test_logout_resources.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/service/test/unit/resources/test_logout_resources.py b/service/test/unit/resources/test_logout_resources.py index 48cf9db9..6246eeb9 100644 --- a/service/test/unit/resources/test_logout_resources.py +++ b/service/test/unit/resources/test_logout_resources.py @@ -1,6 +1,7 @@ from mock import patch from mockito import mock, verify from twisted.trial import unittest +from twisted.web.error import UnsupportedMethod from twisted.web.test.requesthelper import DummyRequest from pixelated.resources.logout_resource import LogoutResource @@ -16,6 +17,7 @@ class TestLogoutResource(unittest.TestCase): @patch('twisted.web.util.redirectTo') def test_logout(self, mock_redirect): request = DummyRequest(['/logout']) + request.method = 'POST' mock_redirect.return_value = 'haha' @@ -29,3 +31,9 @@ class TestLogoutResource(unittest.TestCase): d.addCallback(expire_session_and_redirect) return d + + def test_get_is_not_supported_for_logout(self): + request = DummyRequest(['/logout']) + request.method = 'GET' + + self.assertRaises(UnsupportedMethod, self.web.get, request) |