@@ -257,6 +257,11 @@ def f(input_value, info):
257257 ('no_such_attribute' , "Object has no attribute 'wrong_name'" , {'attribute' : 'wrong_name' }),
258258 ('json_invalid' , 'Invalid JSON: foobar' , {'error' : 'foobar' }),
259259 ('json_type' , 'JSON input should be string, bytes or bytearray' , None ),
260+ (
261+ 'needs_python_object' ,
262+ 'Cannot check `isinstance` when validating from json, use a JsonOrPython validator instead' ,
263+ {'method_name' : 'isinstance' },
264+ ),
260265 ('recursion_loop' , 'Recursion error - cyclic reference detected' , None ),
261266 ('model_type' , 'Input should be a valid dictionary or instance of Foobar' , {'class_name' : 'Foobar' }),
262267 ('model_attributes_type' , 'Input should be a valid dictionary or object to extract fields from' , None ),
@@ -506,10 +511,10 @@ def test_all_errors():
506511 'example_context' : None ,
507512 },
508513 {
509- 'type' : 'recursion_loop ' ,
510- 'message_template_python' : 'Recursion error - cyclic reference detected ' ,
511- 'example_message_python' : 'Recursion error - cyclic reference detected ' ,
512- 'example_context' : None ,
514+ 'type' : 'needs_python_object ' ,
515+ 'message_template_python' : 'Cannot check `{method_name}` when validating from json, use a JsonOrPython validator instead ' ,
516+ 'example_message_python' : 'Cannot check `` when validating from json, use a JsonOrPython validator instead ' ,
517+ 'example_context' : { 'method_name' : '' } ,
513518 },
514519 ]
515520
0 commit comments