File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,24 @@ def __str__(self):
162162 '<a href="http://www.example.com/">example</a></li></ul>' ,
163163 )
164164
165+ def test_error_list_copy (self ):
166+ e = ErrorList (
167+ [
168+ ValidationError (
169+ message = "message %(i)s" ,
170+ params = {"i" : 1 },
171+ ),
172+ ValidationError (
173+ message = "message %(i)s" ,
174+ params = {"i" : 2 },
175+ ),
176+ ]
177+ )
178+
179+ e_copy = copy .copy (e )
180+ self .assertEqual (e , e_copy )
181+ self .assertEqual (e .as_data (), e_copy .as_data ())
182+
165183 def test_error_list_copy_attributes (self ):
166184 class CustomRenderer (DjangoTemplates ):
167185 pass
@@ -195,6 +213,16 @@ def test_error_dict_copy(self):
195213 e_deepcopy = copy .deepcopy (e )
196214 self .assertEqual (e , e_deepcopy )
197215
216+ def test_error_dict_copy_attributes (self ):
217+ class CustomRenderer (DjangoTemplates ):
218+ pass
219+
220+ renderer = CustomRenderer ()
221+ e = ErrorDict (renderer = renderer )
222+
223+ e_copy = copy .copy (e )
224+ self .assertEqual (e .renderer , e_copy .renderer )
225+
198226 def test_error_dict_html_safe (self ):
199227 e = ErrorDict ()
200228 e ["username" ] = "Invalid username."
You can’t perform that action at this time.
0 commit comments