Getting the following error while trying to run the django tests over mysql database. The installation of the mysql database is done properly and a database named test_djangotest is also being created, but the process terminates after that showing the following error message. If anyone setting up the tests in windows device can share their configuration or share a possible fix, it would be very helpful.
CMD Command : python runtests.py --settings=test_mysql
Error message :
Testing against Django installed in 'C:\Users\akash\Desktop\Djangocon\django\django' with up to 8 processes
Found 16321 test(s).
Creating test database for alias 'default'...
Cloning test database for alias 'default'...
Traceback (most recent call last):
File "C:\Users\akash\Desktop\Djangocon\django\tests\runtests.py", line 770, in <module>
failures = django_tests(
File "C:\Users\akash\Desktop\Djangocon\django\tests\runtests.py", line 429, in django_tests
failures = test_runner.run_tests(test_labels)
File "C:\Users\akash\Desktop\Djangocon\django\django\test\runner.py", line 1037, in run_tests
old_config = self.setup_databases(
File "C:\Users\akash\Desktop\Djangocon\django\django\test\runner.py", line 939, in setup_databases
return _setup_databases(
File "C:\Users\akash\Desktop\Djangocon\django\django\test\utils.py", line 212, in setup_databases
connection.creation.clone_test_db(
File "C:\Users\akash\Desktop\Djangocon\django\django\db\backends\base\creation.py", line 256, in clone_test_db
self._clone_test_db(suffix, verbosity, keepdb)
File "C:\Users\akash\Desktop\Djangocon\django\django\db\backends\mysql\creation.py", line 60, in _clone_test_db
self._clone_db(source_database_name, target_database_name)
File "C:\Users\akash\Desktop\Djangocon\django\django\db\backends\mysql\creation.py", line 77, in _clone_db
with subprocess.Popen(
File "C:\Users\akash\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 971, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\akash\AppData\Local\Programs\Python\Python310\lib\subprocess.py", line 1440, in _execute_child
hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified
Device : Windows 10
test_mysql.py File :
DATABASES = {
"default": {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'DJANGOTEST',
'USER': 'root',
'PASSWORD': 'Akash123',
'HOST': 'localhost',
'PORT': '3306',
},
"other": {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'DJANGOOTHER',
'USER': 'root',
'PASSWORD': 'Akash123',
'HOST': 'localhost',
'PORT': '3306',
},
}
SECRET_KEY = "django_tests_secret_key"
# Use a fast hasher to speed up tests.
PASSWORD_HASHERS = [
"django.contrib.auth.hashers.MD5PasswordHasher",
]
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"
USE_TZ = False