'Verify that reviewing revision comment and past revision comments are showing'

def test_revision_comments(self):

    d = self.document
    revs = [RevisionFactory(document=d, is_approved=False, comment='test-{0}'.format(i)) for i in range(7)]
    u = UserFactory()
    add_permission(u, Revision, 'review_revision')
    self.client.login(username=u.username, password='testpass')
    response = get(self.client, 'wiki.review_revision', args=[d.slug, revs[6].id])
    eq_(200, response.status_code)
    doc = pq(response.content)
    doc_content = doc('#review-revision').text()
    assert (revs[6].comment in doc_content)
    subject = doc('.unreviewed-revision').text()
    message = 'Unreviewed    Revisions:'
    assert (message in subject)
    text = doc('ul.revision-comment    li    label')[0].text_content()
    eq_('Revision    Comment:', text)
    revision_comment = doc('ul.revision-comment    li')
    assert (revs[5].comment in revision_comment[0].text_content())
    assert (revs[4].comment in revision_comment[1].text_content())
    assert (revs[3].comment in revision_comment[2].text_content())
    assert (revs[2].comment in revision_comment[3].text_content())
    assert (revs[1].comment in revision_comment[4].text_content())
    assert (revs[0].comment not in revision_comment.text())
    revs[4].reviewed = datetime.now()
    revs[4].is_approved = True
    revs[4].save()
    d.current_revision = revs[4]
    d.save()
    response = get(self.client, 'wiki.review_revision', args=[d.slug, revs[6].id])
    doc = pq(response.content)
    revision_comment = doc('ul.revision-comment    li').text()
    assert (revs[5].comment in revision_comment)
    assert (revs[4].comment not in revision_comment)
    assert (revs[3].comment not in revision_comment)
    assert (revs[2].comment not in revision_comment)
    assert (revs[1].comment not in revision_comment)
    assert (revs[0].comment not in revision_comment)
    subject = doc('.unreviewed-revision').text()
    message = 'Unreviewed    Revision:'
    assert (message in subject)
