summary refs log tree commit diff
path: root/tests/rest/client/v2_alpha/test_register.py
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2021-08-06 11:13:34 +0100
committerGitHub <noreply@github.com>2021-08-06 10:13:34 +0000
commit74d7336686e7de1d0923d67af61b510ec801fa84 (patch)
tree241ec77732f909ac13d1f3c5cf2fdb1fc3ce10d2 /tests/rest/client/v2_alpha/test_register.py
parentMark all MSC2716 events as historical (#10537) (diff)
downloadsynapse-74d7336686e7de1d0923d67af61b510ec801fa84.tar.xz
Add a setting to disable TLS for sending email (#10546)
This is mostly useful in case the server offers TLS, but doesn't present a valid certificate.
Diffstat (limited to 'tests/rest/client/v2_alpha/test_register.py')
-rw-r--r--tests/rest/client/v2_alpha/test_register.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/rest/client/v2_alpha/test_register.py b/tests/rest/client/v2_alpha/test_register.py
index 1cad5f00eb..a52e5e608a 100644
--- a/tests/rest/client/v2_alpha/test_register.py
+++ b/tests/rest/client/v2_alpha/test_register.py
@@ -509,10 +509,6 @@ class AccountValidityRenewalByEmailTestCase(unittest.HomeserverTestCase):
         }
 
         # Email config.
-        self.email_attempts = []
-
-        async def sendmail(*args, **kwargs):
-            self.email_attempts.append((args, kwargs))
 
         config["email"] = {
             "enable_notifs": True,
@@ -532,7 +528,13 @@ class AccountValidityRenewalByEmailTestCase(unittest.HomeserverTestCase):
         }
         config["public_baseurl"] = "aaa"
 
-        self.hs = self.setup_test_homeserver(config=config, sendmail=sendmail)
+        self.hs = self.setup_test_homeserver(config=config)
+
+        async def sendmail(*args, **kwargs):
+            self.email_attempts.append((args, kwargs))
+
+        self.email_attempts = []
+        self.hs.get_send_email_handler()._sendmail = sendmail
 
         self.store = self.hs.get_datastore()