def post(self): transaction = Transaction.objects.get(transaction_id=self.transaction_id) # send an email when the received amount is high enough if transaction.amount_received >= transaction.amount: campaign = transaction.campaign template = PAYMENT_CONFIRMATION_TEMPLATE send_payment_confirmation(campaign, transaction, template, self.campaign_url)
def post(self): transaction = Transaction.objects.get( transaction_id=self.transaction_id) # send an email when the received amount is high enough if transaction.amount_received >= transaction.amount: campaign = transaction.campaign template = PAYMENT_CONFIRMATION_TEMPLATE send_payment_confirmation(campaign, transaction, template, self.campaign_url)
def test_send_payment_confirmation(self, campaign, transaction_id, perk_id): commands.BeginPayment(transaction_id, campaign.key, Decimal(20), '*****@*****.**', perk_id, "Henner Piffendeckel", False, 'braintree') transaction = Transaction.objects.get(transaction_id=transaction_id) send_payment_confirmation(campaign, transaction, 'test', 'http://test.de/') # Test that one message has been sent. assert len(mail.outbox) == 1 # Verify that the subject of the first message is correct. mail.outbox[0].subject == 'Subject here'