summary refs log tree commit diff
path: root/tests/utils.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-08-09 10:16:16 +0100
committerErik Johnston <erik@matrix.org>2018-08-09 10:16:16 +0100
commit5785b93711da5e61cb6d446d090bb7daac5d61c8 (patch)
treee7dc98431b7f52526f85439e785f58a51df89553 /tests/utils.py
parentPull in necessary stores in federation_reader (diff)
parentMerge pull request #3632 from matrix-org/erikj/refactor_repl_servlet (diff)
downloadsynapse-5785b93711da5e61cb6d446d090bb7daac5d61c8.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/split_federation
Diffstat (limited to 'tests/utils.py')
-rw-r--r--tests/utils.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/utils.py b/tests/utils.py
index 9bff3ff3b9..5d49692c58 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -73,6 +73,13 @@ def setup_test_homeserver(name="test", datastore=None, config=None, reactor=None
         config.block_events_without_consent_error = None
         config.media_storage_providers = []
         config.auto_join_rooms = []
+        config.limit_usage_by_mau = False
+        config.max_mau_value = 50
+        config.mau_limits_reserved_threepids = []
+
+        # we need a sane default_room_version, otherwise attempts to create rooms will
+        # fail.
+        config.default_room_version = "1"
 
         # disable user directory updates, because they get done in the
         # background, which upsets the test runner.
@@ -146,8 +153,9 @@ def setup_test_homeserver(name="test", datastore=None, config=None, reactor=None
     # Need to let the HS build an auth handler and then mess with it
     # because AuthHandler's constructor requires the HS, so we can't make one
     # beforehand and pass it in to the HS's constructor (chicken / egg)
-    hs.get_auth_handler().hash = lambda p: hashlib.md5(p).hexdigest()
-    hs.get_auth_handler().validate_hash = lambda p, h: hashlib.md5(p).hexdigest() == h
+    hs.get_auth_handler().hash = lambda p: hashlib.md5(p.encode('utf8')).hexdigest()
+    hs.get_auth_handler().validate_hash = lambda p, h: hashlib.md5(
+        p.encode('utf8')).hexdigest() == h
 
     fed = kargs.get("resource_for_federation", None)
     if fed:
@@ -220,8 +228,8 @@ class MockHttpResource(HttpServer):
         mock_content.configure_mock(**config)
         mock_request.content = mock_content
 
-        mock_request.method = http_method
-        mock_request.uri = path
+        mock_request.method = http_method.encode('ascii')
+        mock_request.uri = path.encode('ascii')
 
         mock_request.getClientIP.return_value = "-"