summary refs log tree commit diff
path: root/tests/rest
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2022-04-01 13:48:08 +0100
committerGitHub <noreply@github.com>2022-04-01 12:48:08 +0000
commitb7762b0c9f007e92a5b6a29add1c7f1603431889 (patch)
tree1a913930faff3d4102d8dd2ad7ac68b87c61b7e9 /tests/rest
parentMove `update_client_ip` background job from the main process to the backgroun... (diff)
downloadsynapse-b7762b0c9f007e92a5b6a29add1c7f1603431889.tar.xz
Move single-use methods out of `TestCase` (#12348)
These methods are only used by a single testcase, so they shouldn't be
cluttering up the base `TestCase` class.
Diffstat (limited to 'tests/rest')
-rw-r--r--tests/rest/client/test_account.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/rest/client/test_account.py b/tests/rest/client/test_account.py
index 27946febff..e00b5c171c 100644
--- a/tests/rest/client/test_account.py
+++ b/tests/rest/client/test_account.py
@@ -89,6 +89,17 @@ class PasswordResetTestCase(unittest.HomeserverTestCase):
         self.store = hs.get_datastores().main
         self.submit_token_resource = PasswordResetSubmitTokenResource(hs)
 
+    def attempt_wrong_password_login(self, username: str, password: str) -> None:
+        """Attempts to login as the user with the given password, asserting
+        that the attempt *fails*.
+        """
+        body = {"type": "m.login.password", "user": username, "password": password}
+
+        channel = self.make_request(
+            "POST", "/_matrix/client/r0/login", json.dumps(body).encode("utf8")
+        )
+        self.assertEqual(channel.code, 403, channel.result)
+
     def test_basic_password_reset(self) -> None:
         """Test basic password reset flow"""
         old_password = "monkey"