Add test for sending authorisation email to client

This commit is contained in:
Tom Price
2017-04-10 20:50:28 +01:00
parent 306c11bb2f
commit 22119a3d08

View File

@@ -1070,5 +1070,11 @@ class TECEventAuthorisationTest(TestCase):
response = self.client.post(self.url)
self.assertContains(response, 'This field is required.')
mail.outbox = []
response = self.client.post(self.url, {'email': 'client@functional.test'})
self.assertEqual(response.status_code, 301)
self.assertEqual(len(mail.outbox), 1)
email = mail.outbox[1]
self.assertIn(email.to, 'client@functional.test')
self.assertIn(email.body, '/event/%d/'.format(self.event.pk))