Skip to content

Commit

Permalink
fix local tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Sep 4, 2024
1 parent 2dcf7ed commit 2046e30
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ def database_url(database):
db_url = f"postgresql://{database.user}:{database.password}@{database.host}:{database.port}/{database.dbname}"
with psycopg.connect(db_url, autocommit=True) as conn:
with conn.cursor() as cur:
cur.execute(f"ALTER DATABASE {database.dbname} SET TIMEZONE='UTC';")
cur.execute("SET TIME ZONE 'UTC';")

cur.execute("CREATE EXTENSION IF NOT EXISTS postgis;")
# make sure postgis extension exists
assert cur.execute(
Expand Down Expand Up @@ -183,10 +186,6 @@ def app(database_url, monkeypatch):
db_settings.tables = None
db_settings.functions = None

# Remove middlewares https://github.com/encode/starlette/issues/472
app.user_middleware = []
app.middleware_stack = app.build_middleware_stack()

with TestClient(app) as app:
yield app

Expand Down

0 comments on commit 2046e30

Please sign in to comment.