Пример #1
0
 def test_validate(self):
     field = CpfField()
     self.assertIsNone(field.validate('06768725815'))
     self.assertIsNone(field.validate('067.687.258-15'))
     self.assertIsNone(field.validate('067-687-258.15'))
     self.assertEqual('CPF must have exactly 11 characters', field.validate('0676872581'))
     self.assertEqual('CPF must have exactly 11 characters', field.validate('067687258155'))
     self.assertEqual('Invalid CPF', field.validate('067.687.258-00'))
Пример #2
0
 def test_validate(self):
     field = CpfField()
     self.assertIsNone(field.validate("06768725815"))
     self.assertIsNone(field.validate("067.687.258-15"))
     self.assertIsNone(field.validate("067-687-258.15"))
     self.assertEqual("CPF must have exactly 11 characters", field.validate("0676872581"))
     self.assertEqual("CPF must have exactly 11 characters", field.validate("067687258155"))
     self.assertEqual("Invalid CPF", field.validate("067.687.258-00"))