summaryrefslogtreecommitdiff
path: root/addons/payment_stripe/tests
diff options
context:
space:
mode:
authorPierre Masereel <pim@odoo.com>2019-01-10 09:11:47 +0000
committerPierre Masereel <pim@odoo.com>2019-01-10 23:47:57 +0000
commit132717c7b17f0e018b5e565646fa842e6227a079 (patch)
treef56b15f9f332de25b87a9a13f87ffac0878f09c2 /addons/payment_stripe/tests
parent5f724892e7a7b0f43802bf215bf9c96d4e1030f5 (diff)
[FIX] payment_*: tests
PAYPAL ------ The paypal tests are not working working for two reasons: - we check that there is no date in pending state on payment transaction, but since the refactoring in this commit: https://github.com/odoo/odoo/commit/01216345e28374b554bfe95df82d607c591271cf the date is always set before the validation of transaction. - Since the changes on dates, the datetime field doesn't return a string anymore and the comparison fails. So we convert the datetime to string for the comparison. BUCKAROO -------- The buckaroo tests were not working for multiple reasons. STRIPE ------ The payment stripe tests were not working because: - The reference set in transactions were not the same as the ones givent to the payment provider. - we were checking for a script tag in form that has been removed in commit https://github.com/odoo/odoo/commit/7c639be4aadce20bf6662ab347470fadf9afd99f AUTHORIZE --------- This test cannot be tested on runbot due to its server to server way of working closes odoo/odoo#30105
Diffstat (limited to 'addons/payment_stripe/tests')
-rw-r--r--addons/payment_stripe/tests/test_stripe.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/addons/payment_stripe/tests/test_stripe.py b/addons/payment_stripe/tests/test_stripe.py
index 5308f54dbe0..1ef883de93f 100644
--- a/addons/payment_stripe/tests/test_stripe.py
+++ b/addons/payment_stripe/tests/test_stripe.py
@@ -59,9 +59,6 @@ class StripeTest(StripeCommon):
# render the button
res = self.stripe.render('SO404', 320.0, self.currency_euro.id, values=self.buyer_values).decode('utf-8')
- popup_script_src = 'script src="https://checkout.stripe.com/checkout.js"'
- # check form result
- self.assertIn(popup_script_src, res, "Stripe: popup script not found in template render")
# Generated and received
self.assertIn(self.buyer_values.get('partner_email'), res, 'Stripe: email input not found in rendered template')
@@ -87,7 +84,7 @@ class StripeTest(StripeCommon):
u'id': u'ch_172xfnGMfVJxozLwEjSfpfxD',
u'invoice': None,
u'livemode': False,
- u'metadata': {u'reference': u'SO100'},
+ u'metadata': {u'reference': u'SO100-1'},
u'object': u'charge',
u'paid': True,
u'receipt_email': None,
@@ -137,6 +134,7 @@ class StripeTest(StripeCommon):
tx.form_feedback(stripe_post_data, 'stripe')
self.assertEqual(tx.state, 'done', 'Stripe: validation did not put tx into done state')
self.assertEqual(tx.acquirer_reference, stripe_post_data.get('id'), 'Stripe: validation did not update tx id')
+ stripe_post_data['metadata']['reference'] = u'SO100-2'
# reset tx
tx = self.env['payment.transaction'].create({
'amount': 4700,