summary refs log tree commit diff
path: root/tests/server.py
diff options
context:
space:
mode:
authorAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>2022-08-19 16:52:20 +0100
committerGitHub <noreply@github.com>2022-08-19 16:52:20 +0100
commit40e3e68cd7c4ab6bf6d7ae228bacfb0c8ff6fa38 (patch)
tree4499de4d0a947016e0ec257b529b6743782e4d62 /tests/server.py
parentReduce the number of tests using TCP replication. (#13543) (diff)
downloadsynapse-40e3e68cd7c4ab6bf6d7ae228bacfb0c8ff6fa38.tar.xz
Register homeserver modules when creating test homeserver (#13558)
Diffstat (limited to 'tests/server.py')
-rw-r--r--tests/server.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/server.py b/tests/server.py
index 9689e6a0cd..c447d5e4c4 100644
--- a/tests/server.py
+++ b/tests/server.py
@@ -61,6 +61,10 @@ from twisted.web.resource import IResource
 from twisted.web.server import Request, Site
 
 from synapse.config.database import DatabaseConnectionConfig
+from synapse.events.presence_router import load_legacy_presence_router
+from synapse.events.spamcheck import load_legacy_spam_checkers
+from synapse.events.third_party_rules import load_legacy_third_party_event_rules
+from synapse.handlers.auth import load_legacy_password_auth_providers
 from synapse.http.site import SynapseRequest
 from synapse.logging.context import ContextResourceUsage
 from synapse.server import HomeServer
@@ -913,4 +917,14 @@ def setup_test_homeserver(
     # Make the threadpool and database transactions synchronous for testing.
     _make_test_homeserver_synchronous(hs)
 
+    # Load any configured modules into the homeserver
+    module_api = hs.get_module_api()
+    for module, config in hs.config.modules.loaded_modules:
+        module(config=config, api=module_api)
+
+    load_legacy_spam_checkers(hs)
+    load_legacy_third_party_event_rules(hs)
+    load_legacy_presence_router(hs)
+    load_legacy_password_auth_providers(hs)
+
     return hs