Forums

Failure to Run Tests

Hello, i am trying to run my test script but i keep encountering this error - 'Got an error creating the test database: (1044, "Access denied for user 'Core00'@'%' to database 'test_xxx@xxxx_db'")'. I have tried modifying my database configuration in settings.py- DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': os.getenv("DB_NAME"), 'USER': os.getenv('DB_USER'), 'PASSWORD': os.getenv("DB_PASSWORD"), 'HOST': os.getenv("DB_HOST"), 'PORT': os.getenv("PORT"), 'TEST_NAME': 'test_xxxx$xxxx_db' } }. I keep getting the same error

Highlighting the necessary steps will be so useful, thanks

Make sure that env vars are actually populated.

They are. My database works but i am trying to have one for the test database and it keeps failing. The solutions i have found on the forums was to include 'TEST_NAME': {db_name}, which i didn but still getting the same error = 'Got an error creating the test database: (1044, "Access denied for user 'Core00'@'%' to database 'test_xxx@xxxx_db'"

Is your test runner trying to create a database? It would not be able to.