If the test database doesn't exist, I get the following exception when running python manage.py quicktest using MySQL and Django 1.2.4 on Ubuntu 10.04:
$ python manage.py quicktest
Traceback (most recent call last):
File "manage.py", line 11, in <module>
execute_manager(settings)
File "/home/eliot/.virtualenvs/andys_bakery/lib/python2.6/site-packages/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/home/eliot/.virtualenvs/andys_bakery/lib/python2.6/site-packages/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/eliot/.virtualenvs/andys_bakery/lib/python2.6/site-packages/django/core/management/base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/eliot/.virtualenvs/andys_bakery/lib/python2.6/site-packages/django/core/management/base.py", line 220, in execute
output = self.handle(*args, **options)
File "/home/eliot/.virtualenvs/andys_bakery/src/django-test-utils/test_utils/management/commands/quicktest.py", line 30, in handle
failures = test_runner(test_labels, verbosity=verbosity, interactive=interactive)
File "/home/eliot/.virtualenvs/andys_bakery/src/django-test-utils/test_utils/test_runners/keep_database.py", line 69, in run_tests
cursor = connection.cursor()
File "/home/eliot/.virtualenvs/andys_bakery/lib/python2.6/site-packages/django/db/backends/__init__.py", line 75, in cursor
cursor = self._cursor()
File "/home/eliot/.virtualenvs/andys_bakery/lib/python2.6/site-packages/django/db/backends/mysql/base.py", line 297, in _cursor
self.connection = Database.connect(**kwargs)
File "/home/eliot/.virtualenvs/andys_bakery/lib/python2.6/site-packages/MySQLdb/__init__.py", line 81, in Connect
return Connection(*args, **kwargs)
File "/home/eliot/.virtualenvs/andys_bakery/lib/python2.6/site-packages/MySQLdb/connections.py", line 187, in __init__
super(Connection, self).__init__(*args, **kwargs2)
_mysql_exceptions.OperationalError: (1049, "Unknown database 'test_andys_bakery'")
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'andys_bakery', # Or path to database file if using sqlite3.
'USER': 'ab_user', # Not used with sqlite3.
'PASSWORD': 'ab_pass', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'django.contrib.messages',
# Uncomment the next line to enable the admin:
# 'django.contrib.admin',
# Uncomment the next line to enable admin documentation:
# 'django.contrib.admindocs',
'oven',
'test_utils',
)
If the test database doesn't exist, I get the following exception when running
python manage.py quicktest
using MySQL and Django 1.2.4 on Ubuntu 10.04:Versions:
relevant part of settings.py:
bash history: