Skip to content

Commit

Permalink
Using psycopg3
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbyt3r committed Oct 15, 2024
1 parent c8b56ea commit fa9d40f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions backend/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ def csrf(client):
def tuber(postgresql, redis=False):
os.environ['FLASK_DEBUG'] = "true"
os.environ['REDIS_URL'] = ""
os.environ['DATABASE_URL'] = f"postgresql://{postgresql.info.user}:@{postgresql.info.host}:{postgresql.info.port}/{postgresql.info.dbname}"
os.environ['DATABASE_URL'] = f"postgresql+psycopg://{postgresql.info.user}:@{postgresql.info.host}:{postgresql.info.port}/{postgresql.info.dbname}"
os.environ['CIRCUITBREAKER_TIMEOUT'] = "5"
os.environ['ENABLE_CIRCUITBREAKER'] = "true"
mod = importlib.import_module('tuber')
tuber.backgroundjobs = importlib.import_module('tuber.backgroundjobs')
settings_override = {
'TESTING': True,
'SQLALCHEMY_DATABASE_URI': f"postgresql://{postgresql.info.user}:@{postgresql.info.host}:{postgresql.info.port}/{postgresql.info.dbname}"
'SQLALCHEMY_DATABASE_URI': f"postgresql+psycopg://{postgresql.info.user}:@{postgresql.info.host}:{postgresql.info.port}/{postgresql.info.dbname}"
}
mod.app.config.update(settings_override)
if redis:
Expand Down Expand Up @@ -123,7 +123,7 @@ def delete(*args, handle_async=True, **kwargs):
@pytest.fixture
def prod_client(postgresql):
os.environ['REDIS_URL'] = ""
os.environ['DATABASE_URL'] = f"postgresql://{postgresql.info.user}:@{postgresql.info.host}:{postgresql.info.port}/{postgresql.info.dbname}"
os.environ['DATABASE_URL'] = f"postgresql+psycopg://{postgresql.info.user}:@{postgresql.info.host}:{postgresql.info.port}/{postgresql.info.dbname}"
os.environ['CIRCUITBREAKER_TIMEOUT'] = "5"
os.environ['FLASK_DEBUG'] = "false"
tuber = importlib.import_module('tuber')
Expand Down
2 changes: 1 addition & 1 deletion terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ resource "aws_ecs_task_definition" "tuber" {
},
{
"name": "DATABASE_URL",
"value": "postgresql://tuber:${random_password.tuber_db.result}@${aws_db_instance.tuber.endpoint}/tuber"
"value": "postgresql+psycopg://tuber:${random_password.tuber_db.result}@${aws_db_instance.tuber.endpoint}/tuber"
},
{
"name": "GENDER_MAP",
Expand Down

0 comments on commit fa9d40f

Please sign in to comment.