(self)
| 3659 | self.assertEqual(w.as_sql(compiler, connection), ("NOT (dummy)", [])) |
| 3660 | |
| 3661 | def test_empty_nodes(self): |
| 3662 | compiler = WhereNodeTest.MockCompiler() |
| 3663 | empty_w = WhereNode() |
| 3664 | w = WhereNode(children=[empty_w, empty_w]) |
| 3665 | with self.assertRaises(FullResultSet): |
| 3666 | w.as_sql(compiler, connection) |
| 3667 | w.negate() |
| 3668 | with self.assertRaises(EmptyResultSet): |
| 3669 | w.as_sql(compiler, connection) |
| 3670 | w.connector = OR |
| 3671 | with self.assertRaises(EmptyResultSet): |
| 3672 | w.as_sql(compiler, connection) |
| 3673 | w.negate() |
| 3674 | with self.assertRaises(FullResultSet): |
| 3675 | w.as_sql(compiler, connection) |
| 3676 | w = WhereNode(children=[empty_w, NothingNode()], connector=OR) |
| 3677 | with self.assertRaises(FullResultSet): |
| 3678 | w.as_sql(compiler, connection) |
| 3679 | w = WhereNode(children=[empty_w, NothingNode()], connector=AND) |
| 3680 | with self.assertRaises(EmptyResultSet): |
| 3681 | w.as_sql(compiler, connection) |
| 3682 | |
| 3683 | |
| 3684 | class QuerySetExceptionTests(SimpleTestCase): |
nothing calls this directly
no test coverage detected