Changes between Version 1 and Version 2 of Ticket #28478, comment 3


Ignore:
Timestamp:
Aug 14, 2017, 12:25:19 PM (7 years ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28478, comment 3

    v1 v2  
    11I wonder if we could unify `SimpleTestCase.allow_database_queries`, `TransactionTestCase.mutli_db` and this feature under a single `SimpleTestCase.databases` attribute.
    22
    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 accessed to all connection aliases not defined in the test's `databases`.
     3The `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`.
Back to Top