1👍
✅
I think it works when you remove the marker because django tests already have the database access without the marker:
Test classes that subclass django.test.TestCase will have access to
the database always to make them compatible with existing Django
tests. Test classes that subclass Python’s unittest.TestCase need to
have the marker applied in order to access the database.
When you add the marker without specifying Transaction=True, the Transaction is set to False by default:
With transaction=False (the default when not specified), transaction
operations are noops during the test.
Reference: https://pytest-django.readthedocs.io/en/latest/helpers.html#pytest.mark.django_db
Source:stackexchange.com