コード例 #1
0
ファイル: br_tests.py プロジェクト: renzon/gaeforms
 def test_validate(self):
     field = CepField()
     field._set_attr_name('d')
     self.assertIsNone(field.validate('12345678'))
     self.assertIsNone(field.validate('12345-678'))
     self.assertIsNone(field.validate('1234567-8'))
     self.assertEqual('CEP must have exactly 8 characters', field.validate('1234567'))
     self.assertEqual('CEP must have exactly 8 characters', field.validate('123456789'))
     self.assertEqual('CEP must contain only numbers', field.validate('1234567a'))
コード例 #2
0
ファイル: br_tests.py プロジェクト: felipevolpone/gaeforms
 def test_validate(self):
     field = CepField()
     field._set_attr_name("d")
     self.assertIsNone(field.validate("12345678"))
     self.assertIsNone(field.validate("12345-678"))
     self.assertIsNone(field.validate("1234567-8"))
     self.assertEqual("CEP must have exactly 8 characters", field.validate("1234567"))
     self.assertEqual("CEP must have exactly 8 characters", field.validate("123456789"))
     self.assertEqual("CEP must contain only numbers", field.validate("1234567a"))