Exemplo n.º 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'))
Exemplo n.º 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"))
Exemplo n.º 3
0
 def test_localization(self):
     field = CpfField()
     self.assertEqual('', field.localize(''))
     self.assertEqual('', field.localize(None))
     self.assertEquals('067.687.258-15', field.localize('06768725815'))
Exemplo n.º 4
0
 def test_normalization(self):
     field = CpfField()
     self.assertIsNone(field.normalize(''))
     self.assertIsNone(field.normalize(None))
     self.assertEquals('06768725815', field.normalize('067.687.258-15'))
     self.assertEquals('13731760592', field.normalize('13731760592'))
Exemplo n.º 5
0
 def test_localization(self):
     field = CpfField()
     self.assertEqual("", field.localize(""))
     self.assertEqual("", field.localize(None))
     self.assertEquals("067.687.258-15", field.localize("06768725815"))
Exemplo n.º 6
0
 def test_normalization(self):
     field = CpfField()
     self.assertIsNone(field.normalize(""))
     self.assertIsNone(field.normalize(None))
     self.assertEquals("06768725815", field.normalize("067.687.258-15"))
     self.assertEquals("13731760592", field.normalize("13731760592"))