def test_to_to_representation(self): instance = fields.BigIntegerField() self.assertEqual(instance.to_representation('1'), 1)
def test_to_internal_value_raises_validate_exception(self): instance = fields.BigIntegerField() with self.assertRaises(ValidationError): instance.to_internal_value('object')
def test_to_internal_value(self): instance = fields.BigIntegerField() self.assertEqual(instance.to_internal_value(1), 1)
def test_to_internal_value_raises_max_string_length_exception(self): instance = fields.BigIntegerField() with self.assertRaises(ValidationError): data = 'value' * 250 instance.to_internal_value(data)
def test_init_default(self): instance = fields.BigIntegerField() self.assertEqual(instance.min_value, -instance.MAX_BIG_INTEGER - 1) self.assertEqual(instance.max_value, instance.MAX_BIG_INTEGER)