summary refs log tree commit diff
path: root/tests/unittest.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-06-11 14:00:50 +0100
committerErik Johnston <erik@matrix.org>2019-06-11 14:00:50 +0100
commit03b09b32d6e368abe1ac0a5865d1be4fea7de787 (patch)
tree97311ef02ed7c2799fe77cf83b885be787313b4c /tests/unittest.py
parentMerge branch 'release-v1.0.0' of github.com:matrix-org/synapse into matrix-or... (diff)
parentMerge pull request #5424 from matrix-org/erikj/change_password_reset_links (diff)
downloadsynapse-03b09b32d6e368abe1ac0a5865d1be4fea7de787.tar.xz
Merge branch 'release-v1.0.0' of github.com:matrix-org/synapse into matrix-org-hotfixes
Diffstat (limited to 'tests/unittest.py')
-rw-r--r--tests/unittest.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/unittest.py b/tests/unittest.py

index 26204470b1..7dbb64af59 100644 --- a/tests/unittest.py +++ b/tests/unittest.py
@@ -441,3 +441,15 @@ class HomeserverTestCase(TestCase): access_token = channel.json_body["access_token"] return access_token + + def attempt_wrong_password_login(self, username, password): + """Attempts to login as the user with the given password, asserting + that the attempt *fails*. + """ + body = {"type": "m.login.password", "user": username, "password": password} + + request, channel = self.make_request( + "POST", "/_matrix/client/r0/login", json.dumps(body).encode('utf8') + ) + self.render(request) + self.assertEqual(channel.code, 403, channel.result)