diff options
Diffstat (limited to 'service/test/support')
-rw-r--r-- | service/test/support/test_helper.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/service/test/support/test_helper.py b/service/test/support/test_helper.py index 640baf6f..ebe8a897 100644 --- a/service/test/support/test_helper.py +++ b/service/test/support/test_helper.py @@ -108,7 +108,7 @@ class PixRequestMock(DummyRequest): def request_mock(path='', method='GET', body='', headers={}, ajax=True, csrf='token'): dummy = PixRequestMock(path.split('/')) for name, val in headers.iteritems(): - dummy.headers[name.lower()] = val + dummy.requestHeaders.setRawHeaders(name.lower(), [val]) dummy.method = method if isinstance(body, str): dummy.content = io.BytesIO(body) @@ -116,8 +116,8 @@ def request_mock(path='', method='GET', body='', headers={}, ajax=True, csrf='to for key, val in body.items(): dummy.addArg(key, val) if ajax: - dummy.headers['x-requested-with'] = 'XMLHttpRequest' - dummy.headers['x-xsrf-token'] = csrf + dummy.requestHeaders.setRawHeaders('x-requested-with', ['XMLHttpRequest']) + dummy.requestHeaders.setRawHeaders('x-xsrf-token', [csrf]) dummy.addCookie('XSRF-TOKEN', csrf) return dummy |