def test_uses_template(self): form = LetterForm(data) form.deliver() self.assertTrue(mail.outbox[0].body.startswith('A new inquiry:'))
def test_delivers_message_unchanged(self): form = LetterForm(data) form.deliver() self.assertIn(data['text'], mail.outbox[0].body)
def test_sets_sender_as_reply_to(self): form = LetterForm(data) form.deliver() self.assertIn(data['sender'], mail.outbox[0].extra_headers['Reply-To'])
def test_devliver_send_email(self): form = LetterForm(data) form.deliver() self.assertEqual(1, len(mail.outbox))
def test_deliver_sets_subject(self): form = LetterForm(data) form.deliver() self.assertEqual(mail.outbox[0].subject, data['subject'])