(self)
| 52 | self.assertIsNone(num_lt_lookup.lhs.alias) |
| 53 | |
| 54 | def test_complex_query(self): |
| 55 | query = Query(Author) |
| 56 | where = query.build_where(Q(num__gt=2) | Q(num__lt=0)) |
| 57 | self.assertEqual(where.connector, OR) |
| 58 | |
| 59 | lookup = where.children[0] |
| 60 | self.assertIsInstance(lookup, GreaterThan) |
| 61 | self.assertEqual(lookup.rhs, 2) |
| 62 | self.assertEqual(lookup.lhs.target, Author._meta.get_field("num")) |
| 63 | |
| 64 | lookup = where.children[1] |
| 65 | self.assertIsInstance(lookup, LessThan) |
| 66 | self.assertEqual(lookup.rhs, 0) |
| 67 | self.assertEqual(lookup.lhs.target, Author._meta.get_field("num")) |
| 68 | |
| 69 | def test_multiple_fields(self): |
| 70 | query = Query(Item, alias_cols=False) |
nothing calls this directly
no test coverage detected