@@ -116,7 +116,7 @@ def test_min_length_singular(self):
116116 field .clean ([1 ])
117117
118118 def test_size_length (self ):
119- field = SimpleArrayField (forms .CharField (max_length = 27 ), size = 4 )
119+ field = SimpleArrayField (forms .CharField (max_length = 27 ), length = 4 )
120120 with self .assertRaises (exceptions .ValidationError ) as cm :
121121 field .clean (["a" , "b" , "c" ])
122122 self .assertEqual (
@@ -131,7 +131,7 @@ def test_size_length(self):
131131 )
132132
133133 def test_size_length_singular (self ):
134- field = SimpleArrayField (forms .CharField (max_length = 27 ), size = 4 )
134+ field = SimpleArrayField (forms .CharField (max_length = 27 ), length = 4 )
135135 with self .assertRaises (exceptions .ValidationError ) as cm :
136136 field .clean (["a" ])
137137 self .assertEqual (
@@ -146,12 +146,14 @@ def test_required(self):
146146 self .assertEqual (cm .exception .messages [0 ], "This field is required." )
147147
148148 def test_misconfigured (self ):
149- msg = "SimpleArrayField param 'size' cannot be specified with 'max_length' or 'min_length'."
149+ msg = (
150+ "SimpleArrayField param 'length' cannot be specified with 'max_length' or 'min_length'."
151+ )
150152 with self .assertRaises (exceptions .ImproperlyConfigured ) as cm :
151- SimpleArrayField (forms .CharField (), max_length = 3 , size = 2 )
153+ SimpleArrayField (forms .CharField (), max_length = 3 , length = 2 )
152154 self .assertEqual (cm .exception .args [0 ], msg )
153155 with self .assertRaises (exceptions .ImproperlyConfigured ) as cm :
154- SimpleArrayField (forms .CharField (), min_length = 3 , size = 2 )
156+ SimpleArrayField (forms .CharField (), min_length = 3 , length = 2 )
155157 self .assertEqual (cm .exception .args [0 ], msg )
156158
157159 def test_model_field_formfield (self ):
@@ -171,7 +173,7 @@ def test_model_field_formfield_size(self):
171173 model_field = ArrayField (models .CharField (max_length = 27 ), size = 4 )
172174 form_field = model_field .formfield ()
173175 self .assertIsInstance (form_field , SimpleArrayField )
174- self .assertEqual (form_field .size , 4 )
176+ self .assertEqual (form_field .length , 4 )
175177
176178 def test_model_field_choices (self ):
177179 model_field = ArrayField (models .IntegerField (choices = ((1 , "A" ), (2 , "B" ))))
0 commit comments