Beispiel #1
0
 def test_add_cc(self):
     expected_out = ('<?xml version="1.0"?><request><store_id>moneris'
                     '</store_id><api_token>hurgle</api_token><res_add_cc>'
                     '<cust_id>mj</cust_id><phone>1-800-555-5555</phone>'
                     '<email>[email protected]</email><note>I have no note'
                     '</note><pan>4242424242424242</pan><expdate>0901'
                     '</expdate><crypt_type>1</crypt_type><avs_info>'
                     '<avs_street_number>123</avs_street_number>'
                     '<avs_street_name>East Street</avs_street_name>'
                     '<avs_zipcode>M1M2M2</avs_zipcode></avs_info>'
                     '</res_add_cc></request>')
     txn = Transaction(type='res_add_cc',
                       cust_id='mj',
                       phone='1-800-555-5555',
                       email='*****@*****.**',
                       note='I have no note',
                       pan='4242424242424242',
                       expdate='0901',
                       crypt_type='1')
     txn.add_avs_info('123', 'East Street', 'M1M2M2')
     # we call the internal _to_xml() which is called by the
     # do_request method in order to bypass actually performing the
     # request, parsing response xml, etc, etc.  We'll be doing
     # this through out the rest of this test case.
     test_out = self.svr._to_xml(txn)
     assert test_out == expected_out
 def test_add_cc(self):
     expected_out = ('<?xml version="1.0"?><request><store_id>moneris'
                     '</store_id><api_token>hurgle</api_token><res_add_cc>'
                     '<cust_id>mj</cust_id><phone>1-800-555-5555</phone>'
                     '<email>[email protected]</email><note>I have no note'
                     '</note><pan>4242424242424242</pan><expdate>0901'
                     '</expdate><crypt_type>1</crypt_type><avs_info>'
                     '<avs_street_number>123</avs_street_number>'
                     '<avs_street_name>East Street</avs_street_name>'
                     '<avs_zipcode>M1M2M2</avs_zipcode></avs_info>'
                     '</res_add_cc></request>')
     txn = Transaction(type='res_add_cc',
                       cust_id='mj',
                       phone='1-800-555-5555',
                       email='*****@*****.**',
                       note='I have no note',
                       pan='4242424242424242',
                       expdate='0901',
                       crypt_type='1')
     txn.add_avs_info('123', 'East Street', 'M1M2M2')
     # we call the internal _to_xml() which is called by the
     # do_request method in order to bypass actually performing the
     # request, parsing response xml, etc, etc.  We'll be doing
     # this through out the rest of this test case.
     test_out = self.svr._to_xml(txn)
     assert test_out == expected_out