Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#23933 closed New feature (fixed)

Override_settings with DATABASE_ROUTERS

Reported by: Wojtek Ruszczewski Owned by: nobody
Component: Testing framework Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Currently, the override_settings decorator with DATABASE_ROUTERS has no effect on the master django.db.router.

ConnectionRouter.routers is wrapped in cached_property, so it doesn't see any settings changes. It seems that registering a setting_changed handler would be enough to make writing tests needing a modified set of routers straightforward.

Change History (3)

comment:1 by Tim Graham, 10 years ago

Triage Stage: UnreviewedAccepted

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

Resolution: fixed
Status: newclosed

In e6f19ec3223ba7c398aea515c5e0f8b93e6f4359:

Fixed #23933 -- Made override_settings(DATABASE_ROUTERS) affect the master router.

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

In 9136ceb6fb8225625631671147ff70c1fcfbbcdc:

Replaced router.routers usage with override_settings(DATABASE_ROUTERS); refs #23933.

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