(self)
| 3160 | # NULL" portion in MySQL to prevent unnecessary sorting. |
| 3161 | @skipUnlessDBFeature("requires_explicit_null_ordering_when_grouping") |
| 3162 | def test_null_ordering_added(self): |
| 3163 | query = Tag.objects.values_list("parent_id", flat=True).order_by().query |
| 3164 | query.group_by = ["parent_id"] |
| 3165 | sql = query.get_compiler(DEFAULT_DB_ALIAS).as_sql()[0] |
| 3166 | fragment = "ORDER BY " |
| 3167 | pos = sql.find(fragment) |
| 3168 | self.assertEqual(sql.find(fragment, pos + 1), -1) |
| 3169 | self.assertEqual(sql.find("NULL", pos + len(fragment)), pos + len(fragment)) |
| 3170 | |
| 3171 | def test_in_list_limit(self): |
| 3172 | # The "in" lookup works with lists of 1000 items or more. |
nothing calls this directly
no test coverage detected