rough-electrician-21871
05/16/2022, 4:58 PMpants
? In conventional CI tool I'd just docker-compose up
stuff and run my pytest
polite-garden-50641
05/16/2022, 5:31 PMpolite-garden-50641
05/16/2022, 5:31 PMdef get_test_db_config(test_db: db_name: str) -> dict:
return {
"ENGINE": "django.db.backends.postgresql",
"NAME": "postgres",
"USER": "postgres",
"HOST": DB_HOST,
"PORT": DB_PORT,
"TEST": {
"DEPENDENCIES": [],
# NB: We use a random UUID to ensure that tests run concurrently (i.e. through the V2 test
# runner) do not share the same database name.
"NAME": f"testdb_{db_name}_{shortuuid.uuid()}",
},
}
DATABASES = {"users_db": get_test_db_config("users_db")}
polite-garden-50641
05/16/2022, 5:32 PMexamle-django
repo to use a real wold DB or at least document that case.... this is a very common scenario that should be addressed in docs.rough-electrician-21871
05/16/2022, 8:10 PM