[Django] #24293: contrib.sites.tests.CreateDefaultSiteTests.test_multi_db expect "other" database to exist, but doesn't create one

7 views
Skip to first unread message

Django

unread,
Feb 6, 2015, 10:06:25 AM2/6/15
to django-...@googlegroups.com
#24293: contrib.sites.tests.CreateDefaultSiteTests.test_multi_db expect "other"
database to exist, but doesn't create one
-------------------------------+--------------------
Reporter: teferi | Owner: nobody
Type: Bug | Status: new
Component: contrib.sites | Version: 1.7
Severity: Normal | Keywords: tests
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
The bug is easily reproducible on a clean installation of django 1.7.3+
via `./manage.py test django.contrib.sites`

The problem is within the test `CreateDefaultSiteTests.test_multi_db`. The
line that fails is
{{{
create_default_site(self.app_config, using='other', verbosity=0)
}}}
. It would fail unless you have "other" database defined in DATABASES dict
in settings. I guess the test should ensure, that "other" DATABASE exists
before querying it. At least by setting `DATABASES['other'] =
DATABASES['default']`

--
Ticket URL: <https://code.djangoproject.com/ticket/24293>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Feb 6, 2015, 10:25:59 AM2/6/15
to django-...@googlegroups.com
#24293: contrib.sites.tests.CreateDefaultSiteTests.test_multi_db expect "other"
database to exist, but doesn't create one
-------------------------------+--------------------------------------

Reporter: teferi | Owner: nobody
Type: Bug | Status: new
Component: contrib.sites | Version: 1.7
Severity: Normal | Resolution:

Keywords: tests | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by teferi):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Old description:

> The bug is easily reproducible on a clean installation of django 1.7.3+
> via `./manage.py test django.contrib.sites`
>
> The problem is within the test `CreateDefaultSiteTests.test_multi_db`.
> The line that fails is
> {{{
> create_default_site(self.app_config, using='other', verbosity=0)
> }}}
> . It would fail unless you have "other" database defined in DATABASES
> dict in settings. I guess the test should ensure, that "other" DATABASE
> exists before querying it. At least by setting `DATABASES['other'] =
> DATABASES['default']`

New description:

The bug is easily reproducible on a clean installation of django 1.7.3+
via `./manage.py test django.contrib.sites`

The problem is within the test `CreateDefaultSiteTests.test_multi_db`. The
line that fails is
{{{
create_default_site(self.app_config, using='other', verbosity=0)
}}}
. It would fail unless you have "other" database defined in DATABASES dict
in settings.

The exception raised is `ConnectionDoesNotExist: The connection other
doesn't exist`

I guess the test should ensure, that "other" DATABASE exists before
querying it. At least by setting `DATABASES['other'] =
DATABASES['default']`

--

--
Ticket URL: <https://code.djangoproject.com/ticket/24293#comment:1>

Django

unread,
Feb 9, 2015, 10:13:00 AM2/9/15
to django-...@googlegroups.com
#24293: contrib.sites.tests.CreateDefaultSiteTests.test_multi_db expect "other"
database to exist, but doesn't create one
-------------------------------+--------------------------------------

Reporter: teferi | Owner: nobody
Type: Bug | Status: new
Component: contrib.sites | Version: 1.7
Severity: Normal | Resolution:

Keywords: tests | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by timgraham):

We might consider fixing this for 1.7, but I questioned whether or not we
need to ship tests with contrib apps in this
[https://groups.google.com/d/topic/django-
developers/nj_Zha341pA/discussion django-developers thread].

--
Ticket URL: <https://code.djangoproject.com/ticket/24293#comment:2>

Django

unread,
Feb 12, 2015, 8:05:59 AM2/12/15
to django-...@googlegroups.com
#24293: contrib.sites.tests.CreateDefaultSiteTests.test_multi_db expect "other"
database to exist, but doesn't create one
-------------------------------+--------------------------------------
Reporter: teferi | Owner: nobody
Type: Bug | Status: closed
Component: contrib.sites | Version: 1.7
Severity: Normal | Resolution: fixed

Keywords: tests | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"0c9e006d5fddfe470553d792e2ecee02f467f2a8"]:
{{{
#!CommitTicketReference repository=""
revision="0c9e006d5fddfe470553d792e2ecee02f467f2a8"
[1.7.x] Fixed #24293 -- Skipped a contrib.sites test if multiple databases
aren't setup.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/24293#comment:3>

Reply all
Reply to author
Forward
0 new messages