From 770b439c8495c3a0b16550c2f04740f31646d66b Mon Sep 17 00:00:00 2001 From: Roald de Vries Date: Thu, 1 Dec 2016 10:36:29 +0100 Subject: WIP: add csrf token to every request --- service/test/unit/resources/test_inbox_resource.py | 26 ---------------------- 1 file changed, 26 deletions(-) (limited to 'service/test/unit/resources/test_inbox_resource.py') diff --git a/service/test/unit/resources/test_inbox_resource.py b/service/test/unit/resources/test_inbox_resource.py index 03fe6f1a..9af355ca 100644 --- a/service/test/unit/resources/test_inbox_resource.py +++ b/service/test/unit/resources/test_inbox_resource.py @@ -44,29 +44,3 @@ class TestInboxResource(unittest.TestCase): d.addCallback(assert_response) return d - - def _test_should_renew_xsrf_cookie(self): - request = DummyRequest(['']) - request.addCookie = MagicMock() - generated_csrf_token = 'csrf_token' - mock_sha = MagicMock() - mock_sha.hexdigest = MagicMock(return_value=generated_csrf_token) - - with patch('hashlib.sha256', return_value=mock_sha): - d = self.web.get(request) - - def assert_csrf_cookie(_): - request.addCookie.assert_called_once_with('XSRF-TOKEN', generated_csrf_token) - - d.addCallback(assert_csrf_cookie) - return d - - # TODO should this be here or just in the root resource test? - def test_should_renew_xsrf_cookie_on_startup_mode(self): - self.inbox_resource._mode = MODE_STARTUP - self._test_should_renew_xsrf_cookie() - - # TODO should this be here or just in the root resource test? - def test_should_renew_xsrf_cookie_on_running_mode(self): - self.inbox_resource._mode = MODE_RUNNING - self._test_should_renew_xsrf_cookie() -- cgit v1.2.3