The MyPerson model should be generating the same database queries as the Person model (when the same manager is used in each case).
(self)
| 38 | |
| 39 | class ProxyModelTests(TestCase): |
| 40 | def test_same_manager_queries(self): |
| 41 | """ |
| 42 | The MyPerson model should be generating the same database queries as |
| 43 | the Person model (when the same manager is used in each case). |
| 44 | """ |
| 45 | my_person_sql = ( |
| 46 | MyPerson.other.all().query.get_compiler(DEFAULT_DB_ALIAS).as_sql() |
| 47 | ) |
| 48 | person_sql = ( |
| 49 | Person.objects.order_by("name") |
| 50 | .query.get_compiler(DEFAULT_DB_ALIAS) |
| 51 | .as_sql() |
| 52 | ) |
| 53 | self.assertEqual(my_person_sql, person_sql) |
| 54 | |
| 55 | def test_inheritance_new_table(self): |
| 56 | """ |
nothing calls this directly
no test coverage detected