Example #1
0
 def test_sets_sender_as_reply_to(self):
     form = LetterForm(data)
     form.deliver()
     self.assertIn(data['sender'], mail.outbox[0].extra_headers['Reply-To'])
Example #2
0
 def test_uses_template(self):
     form = LetterForm(data)
     form.deliver()
     self.assertTrue(mail.outbox[0].body.startswith('A new inquiry:'))
Example #3
0
 def test_deliver_sets_subject(self):
     form = LetterForm(data)
     form.deliver()
     self.assertEqual(mail.outbox[0].subject, data['subject'])
Example #4
0
 def test_delivers_message_unchanged(self):
     form = LetterForm(data)
     form.deliver()
     self.assertIn(data['text'], mail.outbox[0].body)
Example #5
0
 def test_is_valid_with_data(self):
     form = LetterForm(data)
     self.assertTrue(form.is_valid())
Example #6
0
 def test_devliver_send_email(self):
     form = LetterForm(data)
     form.deliver()
     self.assertEqual(1, len(mail.outbox))
Example #7
0
 def test_uses_template(self):
     form = LetterForm(data)
     form.deliver()
     self.assertTrue(mail.outbox[0].body.startswith('A new inquiry:'))
Example #8
0
 def test_requires_sender_subject_text(self):
     form = LetterForm({})
     for field in 'sender subject text'.split():
         self.assertIn(field, form.errors)
Example #9
0
 def test_sets_sender_as_reply_to(self):
     form = LetterForm(data)
     form.deliver()
     self.assertIn(data['sender'], mail.outbox[0].extra_headers['Reply-To'])
Example #10
0
 def test_delivers_message_unchanged(self):
     form = LetterForm(data)
     form.deliver()
     self.assertIn(data['text'], mail.outbox[0].body)
Example #11
0
 def test_deliver_sets_subject(self):
     form = LetterForm(data)
     form.deliver()
     self.assertEqual(mail.outbox[0].subject, data['subject'])
Example #12
0
 def test_devliver_send_email(self):
     form = LetterForm(data)
     form.deliver()
     self.assertEqual(1, len(mail.outbox))
Example #13
0
 def test_is_valid_with_data(self):
     form = LetterForm(data)
     self.assertTrue(form.is_valid())