MCPcopy
hub / github.com/django/django / test_translations

Method test_translations

tests/raw_query/tests.py:208–219  ·  view source on GitHub ↗

Test of raw query's optional ability to translate unexpected result column names to specific model fields

(self)

Source from the content-addressed store, hash-verified

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 """

Callers

nothing calls this directly

Calls 2

allMethod · 0.45

Tested by

no test coverage detected