def test_attach_headers(): msg = mail.MailRequest('test_attach_headers', 'tester@localhost', '*****@*****.**', 'Fake body.') comment.attach_headers(msg) for key in ['X-Post-Name', 'X-Post-User-ID', 'X-Post-Domain']: assert key in msg
def COMMENTING(message, user_id=None, post_name=None, host=None, domain=None): comment.attach_headers(message, user_id, post_name, domain) comment.defer_to_queue(message) original = message # keeps the template happy msg = view.respond(locals(), "mail/comment_submitted.msg", From="noreply@%(host)s", To=original['from'], Subject="Your comment has been posted.") relay.deliver(msg) return COMMENTING
def START(message, user_id=None, post_name=None, host=None, domain=None): comment.attach_headers(message, user_id, post_name, domain) CONFIRM.send(relay, "comment", message, "mail/comment_confirm.msg", locals()) return CONFIRMING
def test_attach_headers(): msg = mail.MailRequest("test_attach_headers", "tester@localhost", "*****@*****.**", "Fake body.") comment.attach_headers(msg) for key in ["X-Post-Name", "X-Post-User-ID", "X-Post-Domain"]: assert key in msg