(self)
| 73 | self.assertEqual(band.name, "Pythonistas") |
| 74 | |
| 75 | def test_get_prefetch(self): |
| 76 | self.insert_rows() |
| 77 | |
| 78 | # With prefetch clause |
| 79 | band = ( |
| 80 | Band.objects() |
| 81 | .get((Band.name == "Pythonistas")) |
| 82 | .prefetch(Band.manager) |
| 83 | .run_sync() |
| 84 | ) |
| 85 | assert band is not None |
| 86 | self.assertIsInstance(band.manager, Manager) # type: ignore |
| 87 | |
| 88 | # Just passing it straight into objects |
| 89 | band = ( |
| 90 | Band.objects(Band.manager) |
| 91 | .get((Band.name == "Pythonistas")) |
| 92 | .run_sync() |
| 93 | ) |
| 94 | assert band is not None |
| 95 | self.assertIsInstance(band.manager, Manager) |
| 96 | |
| 97 | |
| 98 | class TestGetOrCreate(DBTestCase): |
nothing calls this directly
no test coverage detected