#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
Resolution: | Keywords:
Triage Stage: Design | Has patch: 0
decision needed | Needs tests: 0
Needs documentation: 0 | Easy pickings: 0
Patch needs improvement: 0 |
UI/UX: 0 |
-------------------------------------+-------------------------------------
Changes (by ramiro):
* stage: Unreviewed => Design decision needed
Comment:
I'm tempted to won't fix this, at least with code.
A settings file for sqlite3 databases whose (all?) the `'NAMES'` are
`':memory:'` makes no sense because I don't think any real world project
would work with such a setup.
If you need to have two (or more) in-memory sqlite3 DBs for testing then
you have two choices:
* Explicitly use the `'TEST_NAME'` DATABASES inner option that, as
[https://docs.djangoproject.com/en/1.3/ref/settings/#test-name
documented], is the right one to use in this situation:
{{{
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'TEST_NAME': ':memory:',
},
'log': {
'ENGINE': 'django.db.backends.sqlite3',
'TEST_NAME': ':memory:',
}
}
}}}
* Simply don't use `'NAME'` nor `'TEST_NAME'` at all (just like we do
with the `test_sqlite.py` settings we
[https://code.djangoproject.com/browser/django/branches/releases/1.3.X/tests/test_sqlite.py
ship] with our test suite.)
I'd not call the above workarounds but rather the correct ways to achieve
what you are after. No need to mess with bogus HOST or PORT values.
--
Ticket URL: <https://code.djangoproject.com/ticket/16329#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 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.