Example #1
0
    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)))
Example #2
0
 def test_NoneField_validates_None_value(self):
     field = NoneField()
     field.validate(None)
Example #3
0
 def test_NoneField_validates_None_value(self):
     field = NoneField()
     field.validate(None)
Example #4
0
    def test_NoneField_raises_ValidationError_on_incorrect_types(self):
        field = NoneField()

        self.assertRaises(ValidationError, field.validate, {})
        self.assertRaises(ValidationError, field.validate, u'')
Example #5
0
    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)))