From 924906d38cc0898121fac31cd2bd20532209687f Mon Sep 17 00:00:00 2001 From: Christopher Neugebauer Date: Sun, 21 Aug 2016 16:56:15 +1000 Subject: [PATCH] Adds test for e-mails being sent when invoices are generated. --- registrasion/tests/test_invoice.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/registrasion/tests/test_invoice.py b/registrasion/tests/test_invoice.py index f1ed6ed0..32ec6c2e 100644 --- a/registrasion/tests/test_invoice.py +++ b/registrasion/tests/test_invoice.py @@ -533,3 +533,11 @@ class InvoiceTestCase(RegistrationCartTestCase): # Now that we don't have CAT_1, we can't checkout this cart with self.assertRaises(ValidationError): invoice = TestingInvoiceController.for_cart(cart.cart) + + def test_sends_email_on_invoice_creation(self): + invoice = self._invoice_containing_prod_1(1) + assert(1, len(self.emails)) + email = self.emails[0] + self.assertEquals(self.USER_1.email, email["to"]) + self.assertEquals("invoice_created", email["kind"]) + self.assertEquals(invoice.invoice, email["context"]["invoice"])