(self)
| 248 | ) |
| 249 | |
| 250 | def test_flatten(self): |
| 251 | q = Q() |
| 252 | self.assertEqual(list(q.flatten()), [q]) |
| 253 | q = Q(NothingNode()) |
| 254 | self.assertEqual(list(q.flatten()), [q, q.children[0]]) |
| 255 | q = Q( |
| 256 | ExpressionWrapper( |
| 257 | Q(RawSQL("id = 0", params=(), output_field=BooleanField())) |
| 258 | | Q(price=Value("4.55")) |
| 259 | | Q(name=Lower("category")), |
| 260 | output_field=BooleanField(), |
| 261 | ) |
| 262 | ) |
| 263 | flatten = list(q.flatten()) |
| 264 | self.assertEqual(len(flatten), 7) |
| 265 | |
| 266 | def test_create_helper(self): |
| 267 | items = [("a", 1), ("b", 2), ("c", 3)] |
nothing calls this directly
no test coverage detected