def test_pay_link(self): """Tests empty pay link. """ locale.setlocale(locale.LC_ALL, 'en_US.UTF-8') from muecke.payment.utils import process_payment result = process_payment(self.request) order = Order.objects.filter()[0] self.assertEqual(order.get_pay_link(self.request), "")
def test_paypal_link(self): """Tests created paypal link. """ payment_method, created = PaymentMethod.objects.get_or_create( id=3, name="PayPal", active=True, ) self.customer.selected_payment_method = payment_method self.customer.save() from muecke.payment.utils import process_payment result = process_payment(self.request) order = Order.objects.filter()[0] self.failIf(order.get_pay_link(self.request).find("paypal") == -1)