summary refs log tree commit diff
path: root/tests/unittest.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-06-11 11:31:12 +0100
committerErik Johnston <erik@matrix.org>2019-06-11 11:34:33 +0100
commit10383e6e6fefe29b007d11220841c17ad9cfc3e1 (patch)
tree35e0a0f45438db7f0c1994e3b4981158042ff959 /tests/unittest.py
parent1.0.0rc3 (diff)
downloadsynapse-10383e6e6fefe29b007d11220841c17ad9cfc3e1.tar.xz
Change password reset links to /_matrix.
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)