def test_send_email_autoescape(): # Make sure HTML is not auto-escaped. s = 'woo&&<>\'""' ctx = dict(name=s, review_url=s, reviewer=s, comments=s, SITE_URL=s) helpers.send_mail('editors/emails/super_review.ltxt', 'aww yeah', ['xx'], ctx) assert len(mail.outbox) == 1 assert mail.outbox[0].body.count(s) == len(ctx)