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