From 22119a3d085ddd00f3370c9380fe49b44edc5717 Mon Sep 17 00:00:00 2001 From: Tom Price Date: Mon, 10 Apr 2017 20:50:28 +0100 Subject: [PATCH] Add test for sending authorisation email to client --- RIGS/test_functional.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RIGS/test_functional.py b/RIGS/test_functional.py index ecaf3ac1..bda1ffc6 100644 --- a/RIGS/test_functional.py +++ b/RIGS/test_functional.py @@ -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))