The below code in conf.py queries database at import time:
def get_fixed_settings() -> Dict[str, bool]:
"""Return fixed settings."""
is_postgresql = connection.vendor == 'postgresql'
has_trigram_extension = False
if is_postgresql:
with connection.cursor() as cursor:
cursor.execute("SELECT COUNT(*) FROM pg_available_extensions WHERE name='pg_trgm'")
For this reason pytest run fails with error:
RuntimeError: Database access not allowed, use the "django_db" mark, or the "db" or "transactional_db" fixtures to enable it.
The below code in conf.py queries database at import time:
For this reason pytest run fails with error: RuntimeError: Database access not allowed, use the "django_db" mark, or the "db" or "transactional_db" fixtures to enable it.
Any ideas what to do with this?