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/handlers/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/handlers/test_profile.py')
-rw-r--r-- | tests/handlers/test_profile.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/handlers/test_profile.py b/tests/handlers/test_profile.py index 4f2c14e4ff..f1f664275f 100644 --- a/tests/handlers/test_profile.py +++ b/tests/handlers/test_profile.py @@ -19,11 +19,12 @@ from twisted.internet import defer from mock import Mock, NonCallableMock +import synapse.types from synapse.api.errors import AuthError from synapse.handlers.profile import ProfileHandler from synapse.types import UserID -from tests.utils import setup_test_homeserver, requester_for_user +from tests.utils import setup_test_homeserver class ProfileHandlers(object): @@ -86,7 +87,7 @@ class ProfileTestCase(unittest.TestCase): def test_set_my_name(self): yield self.handler.set_displayname( self.frank, - requester_for_user(self.frank), + synapse.types.create_requester(self.frank), "Frank Jr." ) @@ -99,7 +100,7 @@ class ProfileTestCase(unittest.TestCase): def test_set_my_name_noauth(self): d = self.handler.set_displayname( self.frank, - requester_for_user(self.bob), + synapse.types.create_requester(self.bob), "Frank Jr." ) @@ -144,7 +145,8 @@ class ProfileTestCase(unittest.TestCase): @defer.inlineCallbacks def test_set_my_avatar(self): yield self.handler.set_avatar_url( - self.frank, requester_for_user(self.frank), "http://my.server/pic.gif" + self.frank, synapse.types.create_requester(self.frank), + "http://my.server/pic.gif" ) self.assertEquals( |