def on_invoice_key__validate(self, widget, value): if value and not validate_invoice_key(value): return ValidationError(_('Invalid key'))
def test_validate_invoice_key(self): self.failIf(validate_invoice_key('3' * 43)) self.failIf(validate_invoice_key('3' * 44)) self.failUnless( validate_invoice_key( '43161103852995000107650010000001821299676414'))
def test_validate_invoice_key(self): self.assertFalse(validate_invoice_key('3' * 43)) self.assertFalse(validate_invoice_key('3' * 44)) self.assertTrue( validate_invoice_key( '43161103852995000107650010000001821299676414'))
def test_validate_invoice_key(self): self.assertFalse(validate_invoice_key('3' * 43)) self.assertFalse(validate_invoice_key('3' * 44)) self.assertTrue(validate_invoice_key( '43161103852995000107650010000001821299676414'))