Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Fix collation for postgres for unit tests (#7359)
Browse files Browse the repository at this point in the history
When running the UTs against a postgres deatbase, we need to set the collation
correctly.
  • Loading branch information
richvdh authored Apr 28, 2020
1 parent 38919b5 commit fb8ff79
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.d/7359.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix collation for postgres for unit tests.
5 changes: 4 additions & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit fb8ff79

Please sign in to comment.