Test of raw query's optional ability to translate unexpected result column names to specific model fields
(self)
| 206 | self.assertSuccessfulRawQuery(Author, query, authors) |
| 207 | |
| 208 | def test_translations(self): |
| 209 | """ |
| 210 | Test of raw query's optional ability to translate unexpected result |
| 211 | column names to specific model fields |
| 212 | """ |
| 213 | query = ( |
| 214 | "SELECT first_name AS first, last_name AS last, dob, id " |
| 215 | "FROM raw_query_author" |
| 216 | ) |
| 217 | translations = {"first": "first_name", "last": "last_name"} |
| 218 | authors = Author.objects.all() |
| 219 | self.assertSuccessfulRawQuery(Author, query, authors, translations=translations) |
| 220 | |
| 221 | def test_params(self): |
| 222 | """ |
nothing calls this directly
no test coverage detected