Esempio n. 1
0
 def test_read_state_model(self):
     """Models within State apps should map to State DBs"""
     router = StateDatasetRouter()
     self.assertEqual("traffic_stops_nc", router.db_for_read(Stop))
Esempio n. 2
0
 def test_syncdb_other_state_statedb(self):
     """State models should not sync to other State DBs"""
     router = StateDatasetRouter()
     self.assertFalse(router.allow_migrate("traffic_stops_nc", "md", Stop))
Esempio n. 3
0
 def test_syncdb_other_model_statedb(self):
     """Other models should not sync to State DBs"""
     router = StateDatasetRouter()
     self.assertFalse(router.allow_migrate("traffic_stops_nc", "auth",
                                           User))
Esempio n. 4
0
 def test_syncdb_other_model_defaultdb(self):
     """Other models should sync to the default DB"""
     router = StateDatasetRouter()
     self.assertTrue(router.allow_migrate("default", "auth", User))
Esempio n. 5
0
 def test_syncdb_state_model_statedb(self):
     """State models should sync to same State DBs"""
     router = StateDatasetRouter()
     self.assertTrue(router.allow_migrate("traffic_stops_nc", "nc", Stop))
Esempio n. 6
0
 def test_write_other_model(self):
     """Models outside State apps should map to the default DB"""
     router = StateDatasetRouter()
     self.assertEqual("default", router.db_for_write(User))
Esempio n. 7
0
 def test_syncdb_state_model_defaultdb(self):
     """State models should not sync to the default DB"""
     router = StateDatasetRouter()
     self.assertFalse(router.allow_migrate("default", "nc", Stop))
Esempio n. 8
0
 def test_read_state_model(self):
     """Models within State apps should map to State DBs"""
     router = StateDatasetRouter()
     self.assertEqual('traffic_stops_nc', router.db_for_read(Stop))
Esempio n. 9
0
 def test_read_other_model(self):
     """Models outside State apps should map to the default DB"""
     router = StateDatasetRouter()
     self.assertEqual('default', router.db_for_read(User))
Esempio n. 10
0
 def test_syncdb_other_model_statedb(self):
     """Other models should not sync to State DBs"""
     router = StateDatasetRouter()
     self.assertFalse(router.allow_syncdb('traffic_stops_nc', User))
Esempio n. 11
0
 def test_syncdb_state_model_statedb(self):
     """State models should sync to State DBs"""
     router = StateDatasetRouter()
     self.assertTrue(router.allow_syncdb('traffic_stops_nc', Stop))
Esempio n. 12
0
 def test_syncdb_other_model_defaultdb(self):
     """Other models should sync to the default DB"""
     router = StateDatasetRouter()
     self.assertTrue(router.allow_syncdb('default', User))
Esempio n. 13
0
 def test_syncdb_state_model_defaultdb(self):
     """State models should not sync to the default DB"""
     router = StateDatasetRouter()
     self.assertFalse(router.allow_syncdb('default', Stop))
Esempio n. 14
0
 def test_write_other_model(self):
     """Models outside State apps should map to the default DB"""
     router = StateDatasetRouter()
     self.assertEqual('default', router.db_for_write(User))