mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-07-25 05:55:20 -04:00
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.
This commit is contained in:
parent
f871222880
commit
b7762b0c9f
4 changed files with 28 additions and 27 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue