initial/predictions/initial_0/django__django-15930_eval.sh
#!/bin/bash
set -uxo pipefail
source /opt/miniconda3/bin/activate
conda activate testbed
cd /testbed
git config --global --add safe.directory /testbed
cd /testbed
git status
git show
git diff 63884829acd207404f2a5c3cc1d6b4cd0a822b70
source /opt/miniconda3/bin/activate
conda activate testbed
python -m pip install -e .
git checkout 63884829acd207404f2a5c3cc1d6b4cd0a822b70 tests/expressions_case/tests.py
git apply -v - <<'EOF_114329324912'
diff --git a/tests/expressions_case/tests.py b/tests/expressions_case/tests.py
--- a/tests/expressions_case/tests.py
+++ b/tests/expressions_case/tests.py
@@ -415,6 +415,16 @@ def test_annotate_with_empty_when(self):
         self.assertEqual(len(objects), CaseTestModel.objects.count())
         self.assertTrue(all(obj.selected == "not selected" for obj in objects))
 
+    def test_annotate_with_full_when(self):
+        objects = CaseTestModel.objects.annotate(
+            selected=Case(
+                When(~Q(pk__in=[]), then=Value("selected")),
+                default=Value("not selected"),
+            )
+        )
+        self.assertEqual(len(objects), CaseTestModel.objects.count())
+        self.assertTrue(all(obj.selected == "selected" for obj in objects))
+
     def test_combined_expression(self):
         self.assertQuerysetEqual(
             CaseTestModel.objects.annotate(

EOF_114329324912
./tests/runtests.py --verbosity 2 --settings=test_sqlite --parallel 1 expressions_case.tests
git checkout 63884829acd207404f2a5c3cc1d6b4cd0a822b70 tests/expressions_case/tests.py
