@@ -110,21 +110,21 @@ def test_validation_error_details(self):
110
110
assert str (error .detail [0 ]) == 'message1'
111
111
assert str (error .detail [1 ]) == 'message2'
112
112
113
+
113
114
class TestvalidationErrorWithDjangoStyle (TestCase ):
114
115
def test_validation_error_details (self ):
115
116
error = ValidationError ('Invalid value: %(value)s' , params = {'value' : '42' })
116
- s = str (error .detail )
117
117
assert str (error .detail [0 ]) == 'Invalid value: 42'
118
-
118
+
119
119
def test_validation_error_details_tuple (self ):
120
- error = ValidationError (detail = ('Invalid value: %(value1)s' , 'Invalid value: %(value2)s' ), params = {'value1' : '42' , 'value2' :'43' })
120
+ error = ValidationError (detail = ('Invalid value: %(value1)s' , 'Invalid value: %(value2)s' ), params = {'value1' : '42' , 'value2' : '43' })
121
121
assert isinstance (error .detail , list )
122
122
assert len (error .detail ) == 2
123
123
assert str (error .detail [0 ]) == 'Invalid value: 42'
124
124
assert str (error .detail [1 ]) == 'Invalid value: 43'
125
125
126
126
def test_validation_error_details_list (self ):
127
- error = ValidationError (detail = ['Invalid value: %(value1)s' , 'Invalid value: %(value2)s' ], params = {'value1' : '42' , 'value2' :'43' })
127
+ error = ValidationError (detail = ['Invalid value: %(value1)s' , 'Invalid value: %(value2)s' ], params = {'value1' : '42' , 'value2' : '43' })
128
128
assert isinstance (error .detail , list )
129
129
assert len (error .detail ) == 2
130
130
assert str (error .detail [0 ]) == 'Invalid value: 42'
0 commit comments