def test_confirmation_email_not_safe(self): with self.client: form = submit_and_store_in_session(**{"callback-safe_to_contact": "NO_MESSAGE"}) msg = create_confirmation_email(form.data) msg = self.receive_email(msg) assert "We will not leave a message" in msg.body
def test_confirmation_email_no_callback(self): with self.client: form = submit_and_store_in_session(contact_type="call") msg = create_confirmation_email(form.data) msg = self.receive_email(msg) assert "reference number is XX-XXXX-XXXX" in msg.body assert "You can now call CLA" in msg.body
def test_confirmation_email_not_safe(self): with self.client: form = submit_and_store_in_session( **{"callback-safe_to_contact": "NO_MESSAGE"}) msg = create_confirmation_email(form.data) msg = self.receive_email(msg) assert "We will not leave a message" in msg.body
def test_confirmation_email(self): with self.client: form = submit_and_store_in_session() msg = create_confirmation_email(form.data) msg = self.receive_email(msg) assert msg.subject == "Your Civil Legal Advice reference number" assert "Dear John Smith" in msg.body assert "reference number is XX-XXXX-XXXX" in msg.body assert "call you back on 0123456789" in msg.body assert "time you selected ({0:%A, %d %B at %H:%M})".format(form.data["callback"]["time"]) in msg.body assert "We will leave a message" in msg.body
def test_confirmation_email(self): with self.client: form = submit_and_store_in_session() msg = create_confirmation_email(form.data) msg = self.receive_email(msg) assert msg.subject == "Your Civil Legal Advice reference number" assert "Dear John Smith" in msg.body assert "reference number is XX-XXXX-XXXX" in msg.body assert "call you back on 0123456789" in msg.body assert "time you selected ({0:%A, %d %B at %H:%M})".format( form.data["callback"]["time"]) in msg.body assert "We will leave a message" in msg.body
def test_confirmation_email(self): with self.client: form = submit_and_store_in_session() msg = create_confirmation_email(form.data) msg = self.receive_email(msg) assert msg.subject == "Your Civil Legal Advice reference number" assert "Dear John Smith" in msg.body assert "reference number is XX-XXXX-XXXX" in msg.body assert "call you back on 0123456789" in msg.body callback_time = form.data["callback"]["time"] self.assertIn( "during your chosen time ({0:%A, %d %B at %H:%M} - {1:%H:%M})". format(callback_time, callback_time + datetime.timedelta(minutes=30)), msg.body, ) assert "We will not leave a message" in msg.body