diff options
author | Felix Hammerl <fhammerl@thoughtworks.com> | 2016-05-13 11:22:01 +0200 |
---|---|---|
committer | Felix Hammerl <fhammerl@thoughtworks.com> | 2016-05-13 11:24:30 +0200 |
commit | 28ce52715394e1b10774a2d29b7d11e194062d05 (patch) | |
tree | 8eb21c7a4c7c4aef858b70c76bdf86c36cf38be7 /service/test/support | |
parent | a2fa18ea2c47571c07b6d4bae387274ac0ccdea6 (diff) |
Issue #691: Refactor to Twisted 16.1.1
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 |