Esempio n. 1
0
    def test01_review_email(self):
        """ Test Review Email """
        comment_text = 'this is a test for review email'
        with self.app.app_context():
            with self.app.config['mail'].record_messages() as outbox:
                with self.app.test_request_context():
                    send_review_email(commenter='test_commenter',
                                      comment_text=comment_text,
                                      path=self.post_path)

            assert len(outbox) == 1
            assert outbox[0].subject == "Someone reviewed your post!"
            # TODO assert format_commenter(commenter) in outbox[0].body
            assert comment_text in outbox[0].body

            title = self.repo.post(self.post_path).headers['title']
            assert title in outbox[0].body
Esempio n. 2
0
    def test01_review_email(self):
        """ Test Review Email """
        comment_text = 'this is a test for review email'
        with self.app.app_context():
            with self.app.config['mail'].record_messages() as outbox:
                with self.app.test_request_context():
                    send_review_email(commenter='test_commenter',
                                      comment_text=comment_text,
                                      path=self.post_path)

            assert len(outbox) == 1
            assert outbox[0].subject == "Someone reviewed your post!"
            # TODO assert format_commenter(commenter) in outbox[0].body
            assert comment_text in outbox[0].body

            title = self.repo.post(self.post_path).headers['title']
            assert title in outbox[0].body
Esempio n. 3
0
    def test01_review_email(self):
        """ Test Review Email """
        commenter = 'test_commenter'
        comment_text = 'this is a test for review email'
        with self.app.app_context():
            with self.app.config['mail'].record_messages() as outbox:
                with self.app.test_request_context():
                    send_review_email(commenter=commenter,
                                      comment_text=comment_text,
                                      post_id=self.web_post_id)

            web_post = (db_session.query(Post).filter(
                Post.id == self.web_post_id).first())
            assert len(outbox) == 1
            assert outbox[0].subject == "Someone reviewed your web post!"
            # TODO assert format_commenter(commenter) in outbox[0].body
            assert comment_text in outbox[0].body
            assert web_post.title in outbox[0].body