diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2016-01-20 12:04:19 +0100 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2016-01-20 15:48:31 +0100 |
| commit | 2d4257da1a747681223cdaa32f7837e820409736 (patch) | |
| tree | 4df54c490ffbba9772953af49341b3ffa409de56 /addons/payment_authorize/tests | |
| parent | 917f4e73c1a35bb4ba5ab4a38e4cdca8a87c3cce (diff) | |
[FIX] payment_authorize: send billing and shipping data
Authorize.net requires both billing and shipping data.
opw-660771
Diffstat (limited to 'addons/payment_authorize/tests')
| -rw-r--r-- | addons/payment_authorize/tests/test_authorize.py | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/addons/payment_authorize/tests/test_authorize.py b/addons/payment_authorize/tests/test_authorize.py index ed71213fc0c..a9e735f6c25 100644 --- a/addons/payment_authorize/tests/test_authorize.py +++ b/addons/payment_authorize/tests/test_authorize.py @@ -71,6 +71,15 @@ class AuthorizeForm(AuthorizeCommon): 'x_phone': '0032 12 34 56 78', 'x_email': 'norbert.buyer@example.com', 'x_state': None, + 'x_ship_to_first_name': 'Norbert', + 'x_ship_to_last_name': 'Buyer', + 'x_ship_to_address': 'Huge Street 2/543', + 'x_ship_to_city': 'Sin City', + 'x_ship_to_zip': '1000', + 'x_ship_to_country': 'Belgium', + 'x_ship_to_phone': '0032 12 34 56 78', + 'x_ship_to_email': 'norbert.buyer@example.com', + 'x_ship_to_state': None, } form_values['x_fp_hash'] = self._authorize_generate_hashing(form_values) @@ -82,14 +91,14 @@ class AuthorizeForm(AuthorizeCommon): # check form result tree = objectify.fromstring(res) self.assertEqual(tree.get('action'), 'https://test.authorize.net/gateway/transact.dll', 'Authorize: wrong form POST url') - for form_input in tree.input: - # Generated and received 'x_fp_hash' are always different so skeep it. - if form_input.get('name') in ['submit', 'x_fp_hash']: + for el in tree.iterfind('input'): + values = el.values() + if values[1] in ['submit', 'x_fp_hash', 'return_url', 'x_state', 'x_ship_to_state']: continue self.assertEqual( - form_input.get('value'), - form_values[form_input.get('name')], - 'Authorize: wrong value for input %s: received %s instead of %s' % (form_input.get('name'), form_input.get('value'), form_values[form_input.get('name')]) + unicode(values[2], "utf-8"), + form_values[values[1]], + 'Authorize: wrong value for input %s: received %s instead of %s' % (values[1], values[2], form_values[values[1]]) ) @mute_logger('openerp.addons.payment_authorize.models.authorize', 'ValidationError') |
