Example #1
0
 def test_unicode(self):
     validator = ProhibitNullCharactersValidator()
     self.assertIsNone(validator(u"\ufffd"))
Example #2
0
 def test_not_null(self):
     validator = ProhibitNullCharactersValidator()
     self.assertIsNone(validator("some text"))
Example #3
0
 def test_None(self):
     validator = ProhibitNullCharactersValidator()
     self.assertIsNone(validator(None))
Example #4
0
 def test_null(self):
     validator = ProhibitNullCharactersValidator()
     with self.assertRaises(ValidationError):
         validator("some \x00text")