summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2020-04-28 14:21:48 +0100
committerGitHub <noreply@github.com>2020-04-28 14:21:48 +0100
commitfb8ff79efd0897b0b7bf52b0c4bb4061a4ef4018 (patch)
treeede045d5c10b9473dfa7902a420ac6c4a711fd2f /tests
parentRun replication streamers on workers (#7146) (diff)
downloadsynapse-fb8ff79efd0897b0b7bf52b0c4bb4061a4ef4018.tar.xz
Fix collation for postgres for unit tests (#7359)
When running the UTs against a postgres deatbase, we need to set the collation
correctly.
Diffstat (limited to '')
-rw-r--r--tests/utils.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/utils.py b/tests/utils.py
index 2079e0143d..037cb134f0 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -74,7 +74,10 @@ def setupdb():
         db_conn.autocommit = True
         cur = db_conn.cursor()
         cur.execute("DROP DATABASE IF EXISTS %s;" % (POSTGRES_BASE_DB,))
-        cur.execute("CREATE DATABASE %s;" % (POSTGRES_BASE_DB,))
+        cur.execute(
+            "CREATE DATABASE %s ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' "
+            "template=template0;" % (POSTGRES_BASE_DB,)
+        )
         cur.close()
         db_conn.close()