summary refs log tree commit diff
path: root/tests/unittest.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-11-06 10:49:20 +0000
committerRichard van der Hoff <richard@matrix.org>2018-11-06 10:49:20 +0000
commit34406cf22cf35f432e8c13d5e203c05ebeceabfd (patch)
treeb135a765bacbf85e14e4ad845e2bc59baf01fc8f /tests/unittest.py
parentMerge remote-tracking branch 'origin/develop' into matrix-org-hotfixes (diff)
parentAdd config variables for enabling terms auth and the policy name (#4142) (diff)
downloadsynapse-34406cf22cf35f432e8c13d5e203c05ebeceabfd.tar.xz
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
Diffstat (limited to 'tests/unittest.py')
-rw-r--r--tests/unittest.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/unittest.py b/tests/unittest.py

index 4d40bdb6a5..5e35c943d7 100644 --- a/tests/unittest.py +++ b/tests/unittest.py
@@ -258,7 +258,13 @@ class HomeserverTestCase(TestCase): """ def make_request( - self, method, path, content=b"", access_token=None, request=SynapseRequest + self, + method, + path, + content=b"", + access_token=None, + request=SynapseRequest, + shorthand=True, ): """ Create a SynapseRequest at the path using the method and containing the @@ -270,6 +276,8 @@ class HomeserverTestCase(TestCase): escaped UTF-8 & spaces and such). content (bytes or dict): The body of the request. JSON-encoded, if a dict. + shorthand: Whether to try and be helpful and prefix the given URL + with the usual REST API path, if it doesn't contain it. Returns: A synapse.http.site.SynapseRequest. @@ -277,7 +285,7 @@ class HomeserverTestCase(TestCase): if isinstance(content, dict): content = json.dumps(content).encode('utf8') - return make_request(method, path, content, access_token, request) + return make_request(method, path, content, access_token, request, shorthand) def render(self, request): """