summaryrefslogtreecommitdiff
path: root/tests/forms_tests
diff options
context:
space:
mode:
authorEric Carrillo <eric.carrillo@newcomlink.com>2015-07-08 19:03:11 -0500
committerTim Graham <timograham@gmail.com>2015-07-14 11:56:08 -0400
commit8ee6a3f1a855bf983639a14fc2393baa8ead741f (patch)
tree5b7da2f38bcd5caf9383c699c97ac1d9c7f35a98 /tests/forms_tests
parent035b0fa60da2e758d0ab7f9d04ef93cdb73c981f (diff)
Fixed #25085 -- Overrode Select widget's __deepcopy__()
Diffstat (limited to 'tests/forms_tests')
-rw-r--r--tests/forms_tests/tests/test_widgets.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/forms_tests/tests/test_widgets.py b/tests/forms_tests/tests/test_widgets.py
index 40ff750f60..2f1b6e48f7 100644
--- a/tests/forms_tests/tests/test_widgets.py
+++ b/tests/forms_tests/tests/test_widgets.py
@@ -1997,3 +1997,18 @@ class SelectDateWidgetTests(SimpleTestCase):
# label tag is correctly associated with first rendered dropdown
a = GetDate({'mydate_month': '1', 'mydate_day': '1', 'mydate_year': '2010'})
self.assertIn('<label for="id_mydate_day">', a.as_p())
+
+
+class SelectWidgetTests(SimpleTestCase):
+
+ def test_deepcopy(self):
+ """
+ __deepcopy__() should copy all attributes properly (#25085).
+ """
+ widget = Select()
+ obj = copy.deepcopy(widget)
+ self.assertTrue(widget is not obj)
+ self.assertEqual(widget.choices, obj.choices)
+ self.assertTrue(widget.choices is not obj.choices)
+ self.assertEqual(widget.attrs, obj.attrs)
+ self.assertTrue(widget.attrs is not obj.attrs)