Example #1
0
 def on_invoice_key__validate(self, widget, value):
     if value and not validate_invoice_key(value):
         return ValidationError(_('Invalid key'))
Example #2
0
 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'))
Example #3
0
 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'))
Example #4
0
 def on_invoice_key__validate(self, widget, value):
     if value and not validate_invoice_key(value):
         return ValidationError(_('Invalid key'))
Example #5
0
 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'))