When I run my unit test using Django-pytest I keep getting the following error.
django.db.utils.OperationalError: (1045, "Access denied for user 'ruach'@'localhost' (using password: YES)"). I am using an sqlite database locally which requires no password and using the decorator @pytest.mark.django_db to read back inserted values in the database so I am unsure what else could be causing this.
I have run unit tests successfully in the past with the configuration so I am puzzled as to what is causing test runner to be denied access.
settings.py
...
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
tests.py
@pytest.mark.django_db
def test_create_and_save_invoices():
...