def test_create(self, mock): invoice = paypal.Invoice(self.invoice_attributes) response = invoice.create() mock.assert_called_once_with( invoice.api, 'v1/invoicing/invoices', self.invoice_attributes, {'PayPal-Request-Id': invoice.request_id}, None) self.assertEqual(response, True)
def setUp(self): self.invoice_attributes = { 'merchant_info': { 'email': '*****@*****.**' }, 'billing_info': [{ 'email': '*****@*****.**' }], 'items': [{ 'name': 'Sutures', 'quantity': 100, 'unit_price': { 'currency': 'USD', 'value': 5 } }] } self.invoice = paypal.Invoice(self.invoice_attributes) self.invoice.id = 'INV2-RUVR-ADWQ-H89Y-ABCD'