Opened 9 years ago

Closed 9 years ago

#24293 closed Bug (fixed)

contrib.sites.tests.CreateDefaultSiteTests.test_multi_db expect "other" database to exist, but doesn't create one

Reported by: k.zaitsev Owned by: nobody
Component: contrib.sites Version: 1.7
Severity: Normal Keywords: tests
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by k.zaitsev)

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']

Change History (3)

comment:1 by k.zaitsev, 9 years ago

Description: modified (diff)

comment:2 by Tim Graham, 9 years ago

We might consider fixing this for 1.7, but I questioned whether or not we need to ship tests with contrib apps in this django-developers thread.

comment:3 by Tim Graham <timograham@…>, 9 years ago

Resolution: fixed
Status: newclosed

In 0c9e006d5fddfe470553d792e2ecee02f467f2a8:

[1.7.x] Fixed #24293 -- Skipped a contrib.sites test if multiple databases aren't setup.

Note: See TracTickets for help on using tickets.
Back to Top