Changeset 12740 for main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/tests/test_demo_provider.py
- Timestamp:
- 12 Mar 2015, 05:23:47 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/tests/test_demo_provider.py
r12734 r12740 1 import unittest 1 2 from zope.component import queryUtility 2 3 from zope.component.hooks import setSite … … 11 12 from waeup.ikoba.payments.payment import Payer, Payee, Payment 12 13 from waeup.ikoba.payments.demo_provider import ( 13 DemoCreditcardPaymentService, 14 DemoCreditcardPaymentService, RE_CC_NUMBER, RE_CSC, 14 15 ) 15 16 from waeup.ikoba.payments.tests.test_payment import FakePayer, FakePayable 16 17 17 18 18 class DemoCreditcarPaymentServiceTests(FunctionalTestCase): 19 class TestDemoProviderHelpers(unittest.TestCase): 20 21 def test_re_cc_number(self): 22 # we recognize valid numbers 23 assert RE_CC_NUMBER.match('a') is None 24 assert RE_CC_NUMBER.match('12345678') is None 25 assert RE_CC_NUMBER.match('1234a5678') is None 26 assert RE_CC_NUMBER.match('132456789') is not None 27 assert RE_CC_NUMBER.match('123456789012345') is not None 28 29 def test_re_csc(self): 30 # we recognize security numbers 31 assert RE_CSC.match('12') is None 32 assert RE_CSC.match('123') is not None 33 assert RE_CSC.match('1234') is not None 34 assert RE_CSC.match('12345') is None 35 assert RE_CSC.match('12A2') is None 36 37 38 class DemoCreditcardPaymentServiceTests(FunctionalTestCase): 19 39 20 40 layer = FunctionalLayer 21 41 22 42 def setUp(self): 23 super(DemoCreditcar PaymentServiceTests, self).setUp()43 super(DemoCreditcardPaymentServiceTests, self).setUp() 24 44 self.app = Company() 25 45 self.getRootFolder()['app'] = self.app
Note: See TracChangeset for help on using the changeset viewer.