[Django] #27835: Make TransactionTestCase raise an error if it accesses non-default database connection without multi_db=True

6 views
Skip to first unread message

Django

unread,
Feb 13, 2017, 1:24:13 PM2/13/17
to django-...@googlegroups.com
#27835: Make TransactionTestCase raise an error if it accesses non-default database
connection without multi_db=True
---------------------------------------------+------------------------
Reporter: Tim Graham | Owner: nobody
Type: New feature | Status: new
Component: Testing framework | Version: master
Severity: Normal | Keywords:
Triage Stage: Accepted | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
---------------------------------------------+------------------------
Suggested by Simon on [https://github.com/django/django/pull/8035 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.

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

Django

unread,
Feb 13, 2017, 1:24:34 PM2/13/17
to django-...@googlegroups.com
#27835: Make TransactionTestCase raise an error if it accesses non-default database
connection without multi_db=True
-----------------------------------+------------------------------------

Reporter: Tim Graham | Owner: nobody
Type: New feature | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by Tim Graham):

* Attachment "27835.diff" added.

Django

unread,
Feb 5, 2020, 7:47:16 AM2/5/20
to django-...@googlegroups.com
#27835: Make TransactionTestCase raise an error if it accesses non-default database
connection without multi_db=True
-----------------------------------+------------------------------------

Reporter: Tim Graham | Owner: nobody
Type: New feature | Status: closed

Component: Testing framework | Version: master
Severity: Normal | Resolution: invalid

Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by felixxm):

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


Comment:

`multi_db` was removed in Django 3.1. Moreover `TransactionTestCase` with
a new `databases` attribute raises errors in such cases (see
8c775391b78b2a4a2b57c5e89ed4888f36aada4b).

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

Reply all
Reply to author
Forward
0 new messages