summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2019-08-29 09:29:46 +0200
committerGitHub <noreply@github.com>2019-08-29 09:29:46 +0200
commitc7f656435cbf4feee3515ae67cfbe12d6bf791fb (patch)
treebb7efccae74c4b163b5913041c774e0479e3a48a
parenta44d80f88e22eda24dacef48e368895ebea96635 (diff)
Added tests for raising an error when passing non-boolean expression to When().
-rw-r--r--tests/expressions_case/tests.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/expressions_case/tests.py b/tests/expressions_case/tests.py
index 94731491e0..f1255cb8e9 100644
--- a/tests/expressions_case/tests.py
+++ b/tests/expressions_case/tests.py
@@ -1331,6 +1331,8 @@ class CaseWhenTests(SimpleTestCase):
with self.assertRaisesMessage(TypeError, msg):
When(condition=object())
with self.assertRaisesMessage(TypeError, msg):
+ When(condition=Value(1, output_field=models.IntegerField()))
+ with self.assertRaisesMessage(TypeError, msg):
When()
def test_empty_q_object(self):