Expanded one of the nomcom tests a bit, and updated a fixture to match the current /nomcom/default/email/feedback_receipt.txt template.

- Legacy-Id: 14223
This commit is contained in:
Henrik Levkowetz 2017-10-20 14:34:03 +00:00
parent 042ca210c9
commit a5e5bb1aab
2 changed files with 6 additions and 3 deletions

View file

@ -146,8 +146,7 @@ $comments: Comments on this candidate</field>
<field to="name.dbtemplatetypename" name="type" rel="ManyToOneRel">plain</field>
<field type="TextField" name="content">Hi,
Your input regarding $nominee for the position of
$position has been received and registered.
Your input regarding $about has been received and registered.
The following comments have been registered:

View file

@ -780,13 +780,17 @@ class NomcomViewsTest(TestCase):
def test_public_feedback(self):
login_testing_unauthorized(self, COMMUNITY_USER, self.public_feedback_url)
position = "IAOC"
empty_outbox()
self.feedback_view(public=True,confirmation=True)
self.feedback_view(public=True, confirmation=True, position=position)
# feedback_view does a nomination internally: there is a lot of email related to that - tested elsewhere
# We're interested in the confirmation receipt here
self.assertEqual(len(outbox),3)
self.assertEqual('NomCom comment confirmation', outbox[2]['Subject'])
email_body = outbox[2].get_payload()
self.assertIn(position, email_body)
self.assertNotIn('$', email_body)
self.assertEqual(self.email_from, outbox[-2]['From'])
self.assertIn('plain', outbox[2]['To'])
self.assertIn(u'Comments with accents äöå', unicode(outbox[2].get_payload(decode=True),"utf-8","replace"))