MCPcopy
hub / github.com/django/django / assertAnnotations

Method assertAnnotations

tests/raw_query/tests.py:117–125  ·  view source on GitHub ↗

The passed raw query results contain the expected annotations

(self, results, expected_annotations)

Source from the content-addressed store, hash-verified

115 self.assertAnnotations(results, ())
116
117 def assertAnnotations(self, results, expected_annotations):
118 """
119 The passed raw query results contain the expected annotations
120 """
121 if expected_annotations:
122 for index, result in enumerate(results):
123 annotation, value = expected_annotations[index]
124 self.assertTrue(hasattr(result, annotation))
125 self.assertEqual(getattr(result, annotation), value)
126
127 def test_rawqueryset_repr(self):
128 queryset = RawQuerySet(raw_query="SELECT * FROM raw_query_author")

Callers 2

assertNoAnnotationsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected