summary refs log tree commit diff
path: root/tests/rest/client/v1
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2016-07-26 16:46:53 +0100
committerRichard van der Hoff <richard@matrix.org>2016-07-26 16:46:53 +0100
commiteb359eced44407b1ee9648f10fdf3df63c8d40ad (patch)
treed2067b5f2fbfcc69f7303c3fa567082a5d9469b6 /tests/rest/client/v1
parentFix typo (diff)
downloadsynapse-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')
-rw-r--r--tests/rest/client/v1/test_profile.py13
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