Opened 9 years ago
Closed 6 years ago
#27835 closed New feature (invalid)
Make TransactionTestCase raise an error if it accesses non-default database connection without multi_db=True
| Reported by: | Tim Graham | Owned by: | nobody |
|---|---|---|---|
| Component: | Testing framework | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Suggested by Simon on my PR to fix some test isolation problems, TransactionTestCase and its subclasses could raise an error if they make queries on non-default databases. A rough sketch of this could be implemented is attached.
Attachments (1)
Change History (2)
by , 9 years ago
| Attachment: | 27835.diff added |
|---|
comment:1 by , 6 years ago
| Resolution: | → invalid |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
multi_dbwas removed in Django 3.1. MoreoverTransactionTestCasewith a newdatabasesattribute raises errors in such cases (see 8c775391b78b2a4a2b57c5e89ed4888f36aada4b).