diff options
author | Richard van der Hoff <richard@matrix.org> | 2016-07-26 16:46:53 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2016-07-26 16:46:53 +0100 |
commit | eb359eced44407b1ee9648f10fdf3df63c8d40ad (patch) | |
tree | d2067b5f2fbfcc69f7303c3fa567082a5d9469b6 /tests/rest/client/v1/test_profile.py | |
parent | Fix typo (diff) | |
download | synapse-eb359eced44407b1ee9648f10fdf3df63c8d40ad.tar.xz |
Add `create_requester` function
Wrap the `Requester` constructor with a function which provides sensible defaults, and use it throughout
Diffstat (limited to 'tests/rest/client/v1/test_profile.py')
-rw-r--r-- | tests/rest/client/v1/test_profile.py | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/tests/rest/client/v1/test_profile.py b/tests/rest/client/v1/test_profile.py index af02fce8fb..1e95e97538 100644 --- a/tests/rest/client/v1/test_profile.py +++ b/tests/rest/client/v1/test_profile.py @@ -14,17 +14,14 @@ # limitations under the License. """Tests REST events for /profile paths.""" -from tests import unittest -from twisted.internet import defer - from mock import Mock +from twisted.internet import defer -from ....utils import MockHttpResource, setup_test_homeserver - +import synapse.types from synapse.api.errors import SynapseError, AuthError -from synapse.types import Requester, UserID - from synapse.rest.client.v1 import profile +from tests import unittest +from ....utils import MockHttpResource, setup_test_homeserver myid = "@1234ABCD:test" PATH_PREFIX = "/_matrix/client/api/v1" @@ -52,7 +49,7 @@ class ProfileTestCase(unittest.TestCase): ) def _get_user_by_req(request=None, allow_guest=False): - return Requester(UserID.from_string(myid), "", False) + return synapse.types.create_requester(myid) hs.get_v1auth().get_user_by_req = _get_user_by_req |