MCPcopy
hub / github.com/django/django / test_create_model4

Method test_create_model4

tests/migrations/test_multidb.py:93–106  ·  view source on GitHub ↗

Test multiple routers.

(self)

Source from the content-addressed store, hash-verified

91 self._test_create_model("test_mltdb_crmo3", should_run=True)
92
93 def test_create_model4(self):
94 """
95 Test multiple routers.
96 """
97 with override_settings(DATABASE_ROUTERS=[AgnosticRouter(), AgnosticRouter()]):
98 self._test_create_model("test_mltdb_crmo4", should_run=True)
99 with override_settings(
100 DATABASE_ROUTERS=[MigrateNothingRouter(), MigrateEverythingRouter()]
101 ):
102 self._test_create_model("test_mltdb_crmo4", should_run=False)
103 with override_settings(
104 DATABASE_ROUTERS=[MigrateEverythingRouter(), MigrateNothingRouter()]
105 ):
106 self._test_create_model("test_mltdb_crmo4", should_run=True)
107
108 def _test_run_sql(self, app_label, should_run, hints=None):
109 with override_settings(DATABASE_ROUTERS=[MigrateEverythingRouter()]):

Callers

nothing calls this directly

Calls 5

_test_create_modelMethod · 0.95
override_settingsClass · 0.90
AgnosticRouterClass · 0.85

Tested by

no test coverage detected