mirror of
				https://github.com/encode/django-rest-framework.git
				synced 2025-11-01 00:17:40 +03:00 
			
		
		
		
	Add repr(value) to the assert msg in FieldValues
This commit is contained in:
		
							parent
							
								
									71ad99e0b2
								
							
						
					
					
						commit
						ae95ed1ec2
					
				|  | @ -533,7 +533,8 @@ class FieldValues: | ||||||
|         Ensure that valid values return the expected validated data. |         Ensure that valid values return the expected validated data. | ||||||
|         """ |         """ | ||||||
|         for input_value, expected_output in get_items(self.valid_inputs): |         for input_value, expected_output in get_items(self.valid_inputs): | ||||||
|             assert self.field.run_validation(input_value) == expected_output |             assert self.field.run_validation(input_value) == expected_output, \ | ||||||
|  |                 'input value: {}'.format(repr(input_value)) | ||||||
| 
 | 
 | ||||||
|     def test_invalid_inputs(self): |     def test_invalid_inputs(self): | ||||||
|         """ |         """ | ||||||
|  | @ -542,11 +543,13 @@ class FieldValues: | ||||||
|         for input_value, expected_failure in get_items(self.invalid_inputs): |         for input_value, expected_failure in get_items(self.invalid_inputs): | ||||||
|             with pytest.raises(serializers.ValidationError) as exc_info: |             with pytest.raises(serializers.ValidationError) as exc_info: | ||||||
|                 self.field.run_validation(input_value) |                 self.field.run_validation(input_value) | ||||||
|             assert exc_info.value.detail == expected_failure |             assert exc_info.value.detail == expected_failure, \ | ||||||
|  |                 'input value: {}'.format(repr(input_value)) | ||||||
| 
 | 
 | ||||||
|     def test_outputs(self): |     def test_outputs(self): | ||||||
|         for output_value, expected_output in get_items(self.outputs): |         for output_value, expected_output in get_items(self.outputs): | ||||||
|             assert self.field.to_representation(output_value) == expected_output |             assert self.field.to_representation(output_value) == expected_output, \ | ||||||
|  |                 'output value: {}'.format(repr(output_value)) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| # Boolean types... | # Boolean types... | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user