#26540: Can't run tests without "default" connection set
-------------------------------------+-------------------------------------
     Reporter:  marcinn              |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  1.8
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by marcinn):

 Setting `dummy` backend results:

 {{{
 Traceback (most recent call last):
   File
 "/home/marcin/myproject/eggs/Django-1.8.6-py2.7.egg/django/test/testcases.py",
 line 946, in setUpClass
     if not connections_support_transactions():
   File
 "/home/marcin/myproject/eggs/Django-1.8.6-py2.7.egg/django/test/testcases.py",
 line 911, in connections_support_transactions
     for conn in connections.all())
   File
 "/home/marcin/myproject/eggs/Django-1.8.6-py2.7.egg/django/test/testcases.py",
 line 911, in <genexpr>
     for conn in connections.all())
   File
 
"/home/marcin/myproject/eggs/Django-1.8.6-py2.7.egg/django/utils/functional.py",
 line 59, in __get__
     res = instance.__dict__[self.name] = self.func(instance)
   File
 
"/home/marcin/myproject/eggs/Django-1.8.6-py2.7.egg/django/db/backends/base/features.py",
 line 216, in supports_transactions
     with self.connection.cursor() as cursor:
   File
 
"/home/marcin/myproject/eggs/Django-1.8.6-py2.7.egg/django/db/backends/base/base.py",
 line 164, in cursor
     cursor = self.make_cursor(self._cursor())
   File
 
"/home/marcin/myproject/eggs/Django-1.8.6-py2.7.egg/django/db/backends/dummy/base.py",
 line 21, in complain
     raise ImproperlyConfigured("settings.DATABASES is improperly
 configured. "
 ImproperlyConfigured: settings.DATABASES is improperly configured. Please
 supply the ENGINE value. Check settings documentation for more details.
 }}}

 > The fact that the default database is mandatory is documented in the
 DATABASES setting

 Yes, but it looks like it could be empty before (?) - #19775.

 > There are still places in Django core code depending on a default
 database (See #13528 for example).

 Yes, also during models registration the default connection is used to
 truncate table names (or something like that). The sqlite3 handler (my
 "default") is preparing some stuff for postgres and mysql (in my case). It
 seems that db router is not used at this stage.

--
Ticket URL: <https://code.djangoproject.com/ticket/26540#comment:2>
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/065.bfa1bb75897bb7022e6132d1d1d22538%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to