Ignore:
Timestamp:
10 Aug 2017, 06:43:59 (7 years ago)
Author:
Henrik Bettermann
Message:

Define MERCHANTID, HOST, HTTPS, API_KEY, SERVICETYPEID in one place.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/remita/tests.py

    r14788 r14790  
    3838EXTERNAL_TESTS = True
    3939
     40MERCHANTID = '2547916'
     41HOST = 'www.remitademo.net'
     42HTTPS = False
     43API_KEY = '1946'
     44SERVICETYPEID = '4430731'
     45
    4046def external_test(func):
    4147    if not EXTERNAL_TESTS:
     
    5056class HelperTests(unittest.TestCase):
    5157
    52     merchantId = '2547916'
    53     serviceTypeId = '4430731'
    54     api_key = '1946'
     58    merchantId = MERCHANTID
     59    host = HOST
     60    https = HTTPS
     61    api_key = API_KEY
     62    serviceTypeId = SERVICETYPEID
     63
    5564    responseurl = 'http://xxxx'
    56     host = 'www.remitademo.net'
     65
    5766    url = '/remita/ecomm/split/init.reg'  # /remita/ecomm/v2/init.reg
    5867    lineitems = (
     
    7281                api_key=self.api_key, orderId=self.orderId,
    7382                amount=self.amount, responseurl=self.responseurl,
    74                 host=self.host, url=self.url, https=False,
     83                host=self.host, url=self.url, https=self.https,
    7584                fullname='Anton Meier', email='am@xxx.de',
    7685                lineitems=self.lineitems)
     
    8493                api_key=self.api_key, orderId=self.orderId,
    8594                amount=self.amount, responseurl=self.responseurl,
    86                 host=self.host, url=self.url, https=False,
     95                host=self.host, url=self.url, https=self.https,
    8796                fullname='Anton Meier', email='am@xxx.de',
    8897                lineitems=self.lineitems)
     
    99108                RRR=self.rrr,
    100109                host=self.host,
    101                 https=False,
     110                https=self.https,
    102111                )
    103112        assert resp['orderId'] == self.orderId
     
    116125    layer = FunctionalLayer
    117126
    118     merchantId = '2547916'
    119     serviceTypeId = '4430731'
    120     api_key = '1946'
     127    merchantId = MERCHANTID
     128    host = HOST
     129    https = HTTPS
     130    api_key = API_KEY
     131
    121132    responseurl = 'http://xxxx'
    122     host = 'www.remitademo.net'
    123133
    124134    # successful transaction
     
    162172            RRR=self.rrr_p,
    163173            host=self.host,
    164             https=False,
     174            https=self.https,
    165175            verify=False)
    166176        assert qr == (
     
    179189            RRR=self.rrr,
    180190            host=self.host,
    181             https=False,
     191            https=self.https,
    182192            verify=False)
    183193        assert qr[0] == True
     
    232242    layer = FunctionalLayer
    233243
    234     merchantId = '2547916'
    235     serviceTypeId = '4430731'
    236     api_key = '1946'
     244    merchantId = MERCHANTID
     245    host = HOST
     246    https = HTTPS
     247    api_key = API_KEY
     248
    237249    responseurl = 'http://xxxx'
    238     host = 'www.remitademo.net'
    239250
    240251    # successful transaction
     
    288299    layer = FunctionalLayer
    289300
    290     merchantId = '2547916'
    291     serviceTypeId = '4430731'
    292     api_key = '1946'
     301    merchantId = MERCHANTID
     302    host = HOST
     303    https = HTTPS
     304    api_key = API_KEY
     305
    293306    responseurl = 'http://xxxx'
    294     host = 'www.remitademo.net'
    295307
    296308    # successful transaction
Note: See TracChangeset for help on using the changeset viewer.