#16329: Django doesn't initialize two databases with the same name, port and 
host
---------------------+-----------------------------------
 Reporter:  canassa  |          Owner:  nobody
     Type:  Bug      |         Status:  new
Milestone:           |      Component:  Testing framework
  Version:  1.3      |       Severity:  Normal
 Keywords:           |   Triage Stage:  Unreviewed
Has patch:  0        |  Easy pickings:  0
    UI/UX:  0        |
---------------------+-----------------------------------
 When you have two or more databases with the same name, port and host the
 test suite will only initialize the first one.

 '''Steps to reproduce:'''

 Create a settings file with the following database configuration and run
 the test suite:

 {{{
 DATABASES = {
     'default': {
         'ENGINE': 'django.db.backends.sqlite3',
         'NAME': ':memory:',
     },

     'log': {
         'ENGINE': 'django.db.backends.sqlite3',
         'NAME': ':memory:',
     }
 }
 }}}

 When the test suit runs Django will only initialize the 'default'
 database.

 {{{
 Creating test database for alias 'default'...
 Ran 4 tests in 4.030s
 }}}

 '''Workaround'''

 A temporary workaround for this issues is changing the second database
 NAME or put anything in the HOST or PORT. That would be enough to mark the
 two databases as distinct from the perspective of the test setup
 mechanism.

 After changing it, this is the test suite output:

 {{{
 Creating test database for alias 'default'...
 Creating test database for alias 'log'...
 Ran 4 tests in 0.076s
 }}}

 Note that the test time has decreased when both databases are initialized.
 This is due to Django failing to initialize the 'log' database on the
 first run which makes the test suite run without transitions enabled.

 For more information, see the topic in the mailing list:
 http://groups.google.com/group/django-
 users/browse_thread/thread/6542c80f1b0e482a

-- 
Ticket URL: <https://code.djangoproject.com/ticket/16329>
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to