diff options
| author | Roald de Vries <rdevries@thoughtworks.com> | 2016-12-01 10:36:29 +0100 | 
|---|---|---|
| committer | Roald de Vries <rdevries@thoughtworks.com> | 2016-12-01 10:36:39 +0100 | 
| commit | 770b439c8495c3a0b16550c2f04740f31646d66b (patch) | |
| tree | 46ed7570ed1b742aca55c22f3efa5532a861cbee /service/test/unit/resources/test_inbox_resource.py | |
| parent | 13378255c02b97184132881599ed47826963f54a (diff) | |
WIP: add csrf token to every request
Diffstat (limited to 'service/test/unit/resources/test_inbox_resource.py')
| -rw-r--r-- | service/test/unit/resources/test_inbox_resource.py | 26 | 
1 files changed, 0 insertions, 26 deletions
| 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() | 
