Exemplo n.º 1
0
 def test_db_for_write(self):
     eq_(MasterSlaveRouter().db_for_write(None), DEFAULT_DB_ALIAS)
Exemplo n.º 2
0
 def test_allow_migrate(self):
     """Make sure allow_migrate() does the right thing for both masters and
     slaves"""
     router = MasterSlaveRouter()
     assert router.allow_migrate(DEFAULT_DB_ALIAS, None, None)
     assert not router.allow_migrate(get_slave(), None, None)
Exemplo n.º 3
0
 def test_db_for_read(self):
     eq_(MasterSlaveRouter().db_for_read(None), get_slave())