[Fixed]-Django pytest – unable to create testdb

1πŸ‘

I’m not sure that pytest.ini will pass environment variable.
Try running like this

DJANGO_SETTINGS_MODULE=testing.test_settings py.test --reuse-db

Also I hope you know that that the name of created db is generated like 'test_' + DATABASES['NAME'] or taken from TEST dictionary

And in your screenshot failing test is test_with_client but you are showing us test_user test’s code.

Leave a comment