mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-09-18 22:44:37 -04:00
Don't check whether the user's account is expired on /send_mail requests
This commit is contained in:
parent
2f62e1f6ff
commit
fe13bd52ac
3 changed files with 44 additions and 3 deletions
|
@ -427,6 +427,41 @@ class AccountValidityRenewalByEmailTestCase(unittest.HomeserverTestCase):
|
|||
|
||||
self.assertEqual(len(self.email_attempts), 1)
|
||||
|
||||
def test_manual_email_send_expired_account(self):
|
||||
user_id = self.register_user("kermit", "monkey")
|
||||
tok = self.login("kermit", "monkey")
|
||||
|
||||
# We need to manually add an email address otherwise the handler will do
|
||||
# nothing.
|
||||
now = self.hs.clock.time_msec()
|
||||
self.get_success(
|
||||
self.store.user_add_threepid(
|
||||
user_id=user_id,
|
||||
medium="email",
|
||||
address="kermit@example.com",
|
||||
validated_at=now,
|
||||
added_at=now,
|
||||
)
|
||||
)
|
||||
|
||||
# Make the account expire.
|
||||
self.reactor.advance(datetime.timedelta(days=8).total_seconds())
|
||||
|
||||
# Ignore all emails sent by the automatic background task and only focus on the
|
||||
# ones sent manually.
|
||||
self.email_attempts = []
|
||||
|
||||
# Test that we're still able to manually trigger a mail to be sent.
|
||||
request, channel = self.make_request(
|
||||
b"POST",
|
||||
"/_matrix/client/unstable/account_validity/send_mail",
|
||||
access_token=tok,
|
||||
)
|
||||
self.render(request)
|
||||
self.assertEquals(channel.result["code"], b"200", channel.result)
|
||||
|
||||
self.assertEqual(len(self.email_attempts), 1)
|
||||
|
||||
|
||||
class AccountValidityBackgroundJobTestCase(unittest.HomeserverTestCase):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue