2 files changed, 2 insertions, 3 deletions
diff --git a/tests/server.py b/tests/server.py
index b9ccde4962..a74fb3fc67 100644
--- a/tests/server.py
+++ b/tests/server.py
@@ -193,6 +193,8 @@ def make_request(
if not path.startswith(b"/"):
path = b"/" + path
+ if isinstance(content, dict):
+ content = json.dumps(content).encode("utf8")
if isinstance(content, str):
content = content.encode("utf8")
diff --git a/tests/unittest.py b/tests/unittest.py
index 8c7979a7c0..3e656b7b12 100644
--- a/tests/unittest.py
+++ b/tests/unittest.py
@@ -429,9 +429,6 @@ class HomeserverTestCase(TestCase):
Returns:
Tuple[synapse.http.site.SynapseRequest, channel]
"""
- if isinstance(content, dict):
- content = json.dumps(content).encode("utf8")
-
return make_request(
self.reactor,
self.site,
|