Ejemplo n.º 1
0
 def test_post_stripe_failure(self):
     with utils.patched_charge_creation_failure():
         rsp = self.client.post(
             self.url,
             {'stripeToken': 'tok_abcdefghijklmnopqurstuvwx'},
             follow=True,
         )
     self.assertContains(rsp, 'Payment for this booking failed (Your card was declined.)')
     self.assertRedirects(rsp, '/accommodation/bookings/new/')
Ejemplo n.º 2
0
 def test_post_stripe_failure(self):
     with utils.patched_charge_creation_failure():
         rsp = self.client.post(
             self.url,
             {'stripeToken': 'tok_abcdefghijklmnopqurstuvwx'},
             follow=True,
         )
     self.assertContains(rsp, 'Payment failed (Your card was declined.)')
     self.assertRedirects(rsp, '/dinners/conference-dinner/')
Ejemplo n.º 3
0
 def test_stripe_failure(self):
     self.client.force_login(self.order.purchaser)
     with utils.patched_charge_creation_failure():
         rsp = self.client.post(
             self.url,
             {'stripeToken': 'tok_abcdefghijklmnopqurstuvwx'},
             follow=True,
         )
     self.assertContains(rsp, 'Payment for this order failed (Your card was declined.)')
     self.assertContains(rsp, '<th>Date</th><td>Unpaid</td>', html=True)
     self.assertContains(rsp, '<div id="stripe-form">')
Ejemplo n.º 4
0
 def test_process_stripe_charge_failure(self):
     token = 'tok_ abcdefghijklmnopqurstuvwx'
     with utils.patched_charge_creation_failure():
         actions.process_stripe_charge(self.order, token)
     self.order.refresh_from_db()
     self.assertEqual(self.order.status, 'failed')