From ae181233aa4c296d5d973eedfc599145ac0d5918 Mon Sep 17 00:00:00 2001 From: mcalinghee Date: Tue, 23 Apr 2024 17:45:24 +0200 Subject: Send an email if the address is already bound to an user account (#16819) Co-authored-by: Mathieu Velten Co-authored-by: Olivier D --- tests/rest/client/test_register.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/rest/client/test_register.py b/tests/rest/client/test_register.py index 859051cdda..694f143eff 100644 --- a/tests/rest/client/test_register.py +++ b/tests/rest/client/test_register.py @@ -22,6 +22,7 @@ import datetime import os from typing import Any, Dict, List, Tuple +from unittest.mock import AsyncMock import pkg_resources @@ -42,6 +43,7 @@ from synapse.types import JsonDict from synapse.util import Clock from tests import unittest +from tests.server import ThreadedMemoryReactorClock from tests.unittest import override_config @@ -58,6 +60,13 @@ class RegisterRestServletTestCase(unittest.HomeserverTestCase): config["allow_guest_access"] = True return config + def make_homeserver( + self, reactor: ThreadedMemoryReactorClock, clock: Clock + ) -> HomeServer: + hs = super().make_homeserver(reactor, clock) + hs.get_send_email_handler()._sendmail = AsyncMock() + return hs + def test_POST_appservice_registration_valid(self) -> None: user_id = "@as_user_kermit:test" as_token = "i_am_an_app_service" -- cgit 1.4.1