Ignore:
Timestamp:
20 Sep 2019, 06:51:47 (5 years ago)
Author:
Henrik Bettermann
Message:

Save modifications. They are completely untested because demo server is offline.

File:
1 edited

Legend:

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

    r15593 r15596  
    113113    def test_query_history(self):
    114114        transaction_id = str(random.randint(100000000, 999999999))
    115         response = query_history(HOST, self.terminal_id,
    116                                 transaction_id, HTTPS, 'http://xxxxx')
     115        raw, formvars = query_history(HOST, self.terminal_id,
     116                                transaction_id, HTTPS)
    117117        self.assertTrue(
    118118            'Transaction with the given transaction_id (%s) not found'
    119             % transaction_id in response)
     119            % transaction_id in raw)
    120120        # Okay, let's create a transaction
    121121        caller_response = create_transaction(transaction_id)
     
    123123        # It seems that the transaction has been created but we don't get a
    124124        # useful response
    125         query_response = query_history(HOST, self.terminal_id,
    126                                 transaction_id, HTTPS, 'http://xxxxx')
     125        raw, formvars = query_history(HOST, self.terminal_id,
     126                                transaction_id, HTTPS)
    127127        self.assertTrue(
    128128            '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"\r\n    '
    129             '"http://www.w3.org/TR/html4/loose.dtd">' in query_response)
     129            '"http://www.w3.org/TR/html4/loose.dtd">' in raw)
    130130        # The same, an 'empty' response obviously means that the transaction
    131131        # was found but no result was  sent to the response_url because the
     
    139139        # Peter has manually created a successful payment. Let's use this one.
    140140        transaction_id = 'etz1568638104web'
    141         query_response = query_history(HOST, self.terminal_id,
    142                                 transaction_id, HTTPS, 'http://xxxxx')
     141        raw, formvars = query_history(HOST, self.terminal_id,
     142                                transaction_id, HTTPS)
    143143        # Now eTranzact is redirecting but the response is still useless
     144        self.assertTrue('Redirecting...' in raw)
    144145        print query_response
    145         self.assertTrue('Redirecting...' in query_response)
    146146        return
    147147
     
    177177        self.browser.getLink("Pay via eTranzact").click()
    178178        self.assertTrue("Pay now" in self.browser.contents)
    179         # create an eTranzact transaction.
    180         logo_url = 'http://xxxx'
    181         responseurl = self.payment_url + '/receive_etranzact'
    182         amount = "%.1f" % self.payment.amount_auth
    183         customer = self.applicant
    184         hashargs =      amount + TERMINAL_ID + self.payment.p_id \
    185             + responseurl + 'DEMO_KEY'
    186         hashvalue = hashlib.md5(hashargs).hexdigest()
    187         post_caller(HOST, HTTPS, TERMINAL_ID,
    188                    self.payment.p_id, responseurl,
    189                    self.payment.amount_auth, customer.email,
    190                    customer.phone,
    191                    customer.display_fullname, hashvalue,
    192                    logo_url)
    193         self.browser.open(self.payment_url + '/requery_history')
    194         # Means of testing end here.
    195 
    196         #hashargs =     amount + TERMINAL_ID + 'etz1568638104web' \
    197         #    + responseurl + 'DEMO_KEY'
    198         #hashvalue = hashlib.md5(hashargs).hexdigest()
    199         #self.browser.open(self.payment_url + '/requery_history')
    200         #self.browser.getControl("Requery now").click()
    201         #import pdb; pdb.set_trace()
    202 
    203179
    204180        return
Note: See TracChangeset for help on using the changeset viewer.