mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 20:44:50 -04:00
Tests for user consent resource (#4140)
This commit is contained in:
parent
5a63589e80
commit
efdcbbe46b
5 changed files with 140 additions and 6 deletions
|
@ -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):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue