diff options
author | Daniel Wagner-Hall <daniel@matrix.org> | 2016-03-03 16:43:42 +0000 |
---|---|---|
committer | Daniel Wagner-Hall <daniel@matrix.org> | 2016-03-03 16:43:42 +0000 |
commit | b4022cc487921ec46942a6a72fb174bb7aa1e459 (patch) | |
tree | 7aa3d0948b96053a705e2150318cb76fba189f38 /tests/handlers/test_profile.py | |
parent | Merge pull request #571 from matrix-org/daniel/asids (diff) | |
download | synapse-b4022cc487921ec46942a6a72fb174bb7aa1e459.tar.xz |
Pass whole requester to ratelimiting
This will enable more detailed decisions
Diffstat (limited to 'tests/handlers/test_profile.py')
-rw-r--r-- | tests/handlers/test_profile.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/handlers/test_profile.py b/tests/handlers/test_profile.py index a87703bbfd..4f2c14e4ff 100644 --- a/tests/handlers/test_profile.py +++ b/tests/handlers/test_profile.py @@ -23,7 +23,7 @@ from synapse.api.errors import AuthError from synapse.handlers.profile import ProfileHandler from synapse.types import UserID -from tests.utils import setup_test_homeserver +from tests.utils import setup_test_homeserver, requester_for_user class ProfileHandlers(object): @@ -84,7 +84,11 @@ class ProfileTestCase(unittest.TestCase): @defer.inlineCallbacks def test_set_my_name(self): - yield self.handler.set_displayname(self.frank, self.frank, "Frank Jr.") + yield self.handler.set_displayname( + self.frank, + requester_for_user(self.frank), + "Frank Jr." + ) self.assertEquals( (yield self.store.get_profile_displayname(self.frank.localpart)), @@ -93,7 +97,11 @@ class ProfileTestCase(unittest.TestCase): @defer.inlineCallbacks def test_set_my_name_noauth(self): - d = self.handler.set_displayname(self.frank, self.bob, "Frank Jr.") + d = self.handler.set_displayname( + self.frank, + requester_for_user(self.bob), + "Frank Jr." + ) yield self.assertFailure(d, AuthError) @@ -136,7 +144,7 @@ class ProfileTestCase(unittest.TestCase): @defer.inlineCallbacks def test_set_my_avatar(self): yield self.handler.set_avatar_url( - self.frank, self.frank, "http://my.server/pic.gif" + self.frank, requester_for_user(self.frank), "http://my.server/pic.gif" ) self.assertEquals( |