#18575: Testing framework doesn't work without a SQL Database
-----------------------------------+------------------------------------
     Reporter:  delormemarco@…     |                    Owner:  nobody
         Type:  Bug                |                   Status:  reopened
    Component:  Testing framework  |                  Version:  1.4
     Severity:  Release blocker    |               Resolution:
     Keywords:  regression         |             Triage Stage:  Accepted
    Has patch:  1                  |      Needs documentation:  0
  Needs tests:  0                  |  Patch needs improvement:  0
Easy pickings:  0                  |                    UI/UX:  0
-----------------------------------+------------------------------------

Comment (by Architekt):

 Yesterday I tried `DATABASES = {}` as author of this ticket did. This
 configuration is not loading dummy backend and everything raises
 ImproperlyConfigured. Even `manage.py shell` is not working. I checked
 comment in dummy backend base.py which says "Right now the dummy backend
 is there for raising ImproperlyConfigured if database configuration is
 missing." so I thinked that all those raises are correct and Django can't
 run without database settings.

 But with setting database engine as `django.db.backends.dummy` or removing
 whole databases configuration from settings is a different story. Shell
 works fine. Tests fail on creating database:
 {{{
 $ ./manage.py test myapp -v 2
 Creating test database for alias 'default' ('test_')...
 ImproperlyConfigured: settings.DATABASES is improperly configured. Please
 supply the ENGINE value. Check settings documentation for more details.
 }}}

 I see here two problems:

 1. In docs is default DATABASES setting empty dict. But when you set
 `DATABASES = {}` in project settings (which doesn't use dummy backend) it
 doesn't work like real default without any DATABASES in project settings
 (which uses dummy backend).

 2. Test runner does not know how to handle dummy database.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/18575#comment:9>
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to