Querysets will use the default database by default
(self)
| 20 | databases = {"default", "other"} |
| 21 | |
| 22 | def test_db_selection(self): |
| 23 | "Querysets will use the default database by default" |
| 24 | self.assertEqual(Book.objects.db, DEFAULT_DB_ALIAS) |
| 25 | self.assertEqual(Book.objects.all().db, DEFAULT_DB_ALIAS) |
| 26 | |
| 27 | self.assertEqual(Book.objects.using("other").db, "other") |
| 28 | |
| 29 | self.assertEqual(Book.objects.db_manager("other").db, "other") |
| 30 | self.assertEqual(Book.objects.db_manager("other").all().db, "other") |
| 31 | |
| 32 | def test_default_creation(self): |
| 33 | """ |
nothing calls this directly
no test coverage detected