summary refs log tree commit diff
path: root/tests/rest/client
diff options
context:
space:
mode:
authormcalinghee <mcalinghee.dev@gmail.com>2024-04-23 17:45:24 +0200
committerGitHub <noreply@github.com>2024-04-23 16:45:24 +0100
commitae181233aa4c296d5d973eedfc599145ac0d5918 (patch)
treea972be7d6af088d9296af3ba9787dd7d94b6ab8f /tests/rest/client
parentAdd an OSX prompt to manually configure icu4c. (#17069) (diff)
downloadsynapse-ae181233aa4c296d5d973eedfc599145ac0d5918.tar.xz
Send an email if the address is already bound to an user account (#16819)
Co-authored-by: Mathieu Velten <mathieu.velten@beta.gouv.fr>
Co-authored-by: Olivier D <odelcroi@gmail.com>
Diffstat (limited to 'tests/rest/client')
-rw-r--r--tests/rest/client/test_register.py9
1 files changed, 9 insertions, 0 deletions
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"