Ignore:
Timestamp:
12 Mar 2015, 05:23:47 (10 years ago)
Author:
uli
Message:

Let cc payments basically run.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/branches/uli-payments/src/waeup/ikoba/payments/tests/test_demo_provider.py

    r12734 r12740  
     1import unittest
    12from zope.component import queryUtility
    23from zope.component.hooks import setSite
     
    1112from waeup.ikoba.payments.payment import Payer, Payee, Payment
    1213from waeup.ikoba.payments.demo_provider import (
    13     DemoCreditcardPaymentService,
     14    DemoCreditcardPaymentService, RE_CC_NUMBER, RE_CSC,
    1415    )
    1516from waeup.ikoba.payments.tests.test_payment import FakePayer, FakePayable
    1617
    1718
    18 class DemoCreditcarPaymentServiceTests(FunctionalTestCase):
     19class 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
     38class DemoCreditcardPaymentServiceTests(FunctionalTestCase):
    1939
    2040    layer = FunctionalLayer
    2141
    2242    def setUp(self):
    23         super(DemoCreditcarPaymentServiceTests, self).setUp()
     43        super(DemoCreditcardPaymentServiceTests, self).setUp()
    2444        self.app = Company()
    2545        self.getRootFolder()['app'] = self.app
Note: See TracChangeset for help on using the changeset viewer.