def test_NoneField_validates_None_value(self): field = NoneField() field.validate(None)
def test_NoneField_raises_ValidationError_on_incorrect_types(self): field = NoneField() self.assertRaises(ValidationError, field.validate, {}) self.assertRaises(ValidationError, field.validate, u'')
def test_NoneField_json_methods(self): f = NoneField() self.assertEquals(None, f.from_json(f.to_json(None))) self.assertEquals(None, f.to_json(f.from_json(None)))