Changes between Version 1 and Version 2 of Ticket #28478, comment 3
- Timestamp:
- Aug 14, 2017, 12:25:19 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #28478, comment 3
v1 v2 1 1 I wonder if we could unify `SimpleTestCase.allow_database_queries`, `TransactionTestCase.mutli_db` and this feature under a single `SimpleTestCase.databases` attribute. 2 2 3 The `databases` attribute could be set to `None` on `SimpleTestCase` and to `{DEFAULT_DB_ALIAS}` on `TransactionTestCase` with a deprecation shim that turns `multi_db = True` into `set(connections)`. The discover runner could simply create the union of all tests's `databases` and the `allow_database_queries` functionality could be reused to block accesse dto all connection aliases not defined in the test's `databases`.3 The `databases` attribute could be set to `None` on `SimpleTestCase` and to `{DEFAULT_DB_ALIAS}` on `TransactionTestCase` with a deprecation shim that turns `multi_db = True` into `set(connections)`. The discover runner could simply create the union of all tests's `databases` and the `allow_database_queries` functionality could be reused to block accesses to all connection aliases not defined in the test's `databases`.