Description
Many thanks for a great package. Works excellent for my use case.
I was beginning to write some tests that involve async tasks, and I realised these tests (pytests) were failing because the async job isnt looking at the right database. How does one point django-q /qcluster to look at the test database that pytest uses.
im mostly using the default settings from Django.
DATABASE related settings.py looks like this
'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': BASE_DIR / 'db.sqlite3', 'TEST': { 'NAME': BASE_DIR / 'testdb.sqlite3', }, },
I am running this to check what is the db being connected to.
from django.db import connection db_name = connection.settings_dict['NAME']
When the function is being run in non async mode - it rightly points to the testdb.sqlite3.
When run using async mode, it points to the db.sqlite3.
How do i make the async task to refer to the testdb.
Any pointers would be very helpful.
PS: If I call the async function with sync=True, then everything works fine.