#24394: Running tests fails when DATABASES['default'] = {}
-------------------------------+--------------------
Reporter: trecouvr | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.7
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
On Django 1.7.x the management command `test` fails when
`DATABASES['default'] = {}` with `AttributeError: 'DatabaseWrapper' object
has no attribute 'Database'`.
This failure is also present on 1.7.3 and 1.7.4 version of Django.
To reproduce the problem:
1. Create a new project
2. Edit the settings.py this way:
{{{
DATABASES = {
'default': {},
'mysite': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db_mysite.sqlite3'),
}
}
}}}
3. Add a dummy test to yout project, for example:
{{{
from django.test import TestCase
class MyTestCase(TestCase):
def test_pouet(self):
pass
}}}
4. Run python manage.py test
Problem:
It seems Django instantiate a dummy connector for `default` and then calls
not implemented methods on this connector.
I am attaching the output log of the command.
Here is a sample project to reproduce the behaviour:
https://github.com/trecouvr/test_dj_migrate_174.
--
Ticket URL: <https://code.djangoproject.com/ticket/24394>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/051.02c2a55a301bcc224c8ce7a80e281848%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.