Beispiel #1
0
 def test_get_payment_method_credit_card_purchase(self):
     """
     Credit card type and Source label should be displayed as the Payment method
     when a Credit card was used to purchase a product.
     """
     order = self.create_order()
     source = factories.SourceFactory(order=order,
                                      card_type='Dummy Card',
                                      label='Test')
     payment_method = ReceiptResponseView().get_payment_method(order)
     self.assertEqual(payment_method,
                      '{} {}'.format(source.card_type, source.label))
Beispiel #2
0
 def test_get_payment_method_no_source(self):
     """ Payment method should be None when an Order has no Payment source. """
     order = self.create_order()
     payment_method = ReceiptResponseView().get_payment_method(order)
     self.assertEqual(payment_method, None)