File tree 1 file changed +28
-0
lines changed
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -162,6 +162,24 @@ def __str__(self):
162
162
'<a href="http://www.example.com/">example</a></li></ul>' ,
163
163
)
164
164
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
+
165
183
def test_error_list_copy_attributes (self ):
166
184
class CustomRenderer (DjangoTemplates ):
167
185
pass
@@ -195,6 +213,16 @@ def test_error_dict_copy(self):
195
213
e_deepcopy = copy .deepcopy (e )
196
214
self .assertEqual (e , e_deepcopy )
197
215
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
+
198
226
def test_error_dict_html_safe (self ):
199
227
e = ErrorDict ()
200
228
e ["username" ] = "Invalid username."
You can’t perform that action at this time.
0 commit comments