initial/predictions/initial_0/django__django-12193_eval.sh
#!/bin/bash
set -uxo pipefail
source /opt/miniconda3/bin/activate
conda activate testbed
cd /testbed
sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
export LANG=en_US.UTF-8
export LANGUAGE=en_US:en
export LC_ALL=en_US.UTF-8
git config --global --add safe.directory /testbed
cd /testbed
git status
git show
git diff 3fb7c12158a2402f0f80824f6778112071235803
source /opt/miniconda3/bin/activate
conda activate testbed
python -m pip install -e .
git checkout 3fb7c12158a2402f0f80824f6778112071235803 tests/forms_tests/widget_tests/test_checkboxinput.py tests/postgres_tests/test_array.py
git apply -v - <<'EOF_114329324912'
diff --git a/tests/forms_tests/widget_tests/test_checkboxinput.py b/tests/forms_tests/widget_tests/test_checkboxinput.py
--- a/tests/forms_tests/widget_tests/test_checkboxinput.py
+++ b/tests/forms_tests/widget_tests/test_checkboxinput.py
@@ -89,3 +89,8 @@ def test_value_from_datadict_string_int(self):
     def test_value_omitted_from_data(self):
         self.assertIs(self.widget.value_omitted_from_data({'field': 'value'}, {}, 'field'), False)
         self.assertIs(self.widget.value_omitted_from_data({}, {}, 'field'), False)
+
+    def test_get_context_does_not_mutate_attrs(self):
+        attrs = {'checked': False}
+        self.widget.get_context('name', True, attrs)
+        self.assertIs(attrs['checked'], False)
diff --git a/tests/postgres_tests/test_array.py b/tests/postgres_tests/test_array.py
--- a/tests/postgres_tests/test_array.py
+++ b/tests/postgres_tests/test_array.py
@@ -1103,6 +1103,17 @@ def test_get_context(self):
             }
         )
 
+    def test_checkbox_get_context_attrs(self):
+        context = SplitArrayWidget(
+            forms.CheckboxInput(),
+            size=2,
+        ).get_context('name', [True, False])
+        self.assertEqual(context['widget']['value'], '[True, False]')
+        self.assertEqual(
+            [subwidget['attrs'] for subwidget in context['widget']['subwidgets']],
+            [{'checked': True}, {}]
+        )
+
     def test_render(self):
         self.check_html(
             SplitArrayWidget(forms.TextInput(), size=2), 'array', None,

EOF_114329324912
./tests/runtests.py --verbosity 2 --settings=test_sqlite --parallel 1 forms_tests.widget_tests.test_checkboxinput postgres_tests.test_array
git checkout 3fb7c12158a2402f0f80824f6778112071235803 tests/forms_tests/widget_tests/test_checkboxinput.py tests/postgres_tests/test_array.py
