Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#22811 closed Cleanup/optimization (fixed)

Cannot create a settings file that uses both old and new TEST database settings

Reported by: Tim Graham Owned by: Tim Graham
Component: Testing framework Version: 1.7-beta-2
Severity: Release blocker Keywords:
Cc: Shai Berger Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I'd like to use the following settings on the continuous integration server, but an ImproperlyConfigured("Connection default has both NAME and TEST[NAME] specified.") exception is currently raised.

# Django <= 1.6
'TEST_NAME': 'test_django_gis_%s_%s' % (PY_VERSION, BUILD_NAME),
# Django 1.7+
'TEST': {
    'NAME': 'test_django_gis_%s_%s' % (PY_VERSION, BUILD_NAME),
},

I think third-party apps that use multiple versions of Django will also run into this and the need to create a separate settings file seems overkill.

It may be a good idea to remove this constraint and to use simply use TEST if defined, ignoring the TEST_* values in that case (without warnings so it's possible to silence them).

Change History (5)

comment:1 by Tim Graham, 10 years ago

Owner: changed from nobody to Tim Graham
Status: newassigned

Shai agreed we can relax this and throw an error only if TEST and TEST_* differ.

comment:2 by Tim Graham, 10 years ago

Has patch: set

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

Resolution: fixed
Status: assignedclosed

In 1c58cabad7f5b792e9cfd8f00feffd8212fdfbb1:

Fixed #22811 -- Allowed setting both the old and new TEST database settings.

An ImproperlyConfigured exception will be raised they mismatch.

comment:4 by Tim Graham <timograham@…>, 10 years ago

In a2cd0e12c9410a7b8a30064e3967c617f4de2de5:

Silenced deprecation warnings for refs #22811 and fixed build.

comment:5 by Tim Graham <timograham@…>, 10 years ago

In e51662e7bc2a946e6656e4954c902451a04eaf0e:

[1.7.x] Fixed #22811 -- Allowed setting both the old and new TEST database settings.

An ImproperlyConfigured exception will be raised they mismatch.

Backport of 1c58cabad7 and a2cd0e12c9 from master

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