'Translate unapproved English document a 2nd time.
Reviewing a revision of a translation when the English document
does not have a current revision should fall back to the latest
English revision.'

def test_review_translation_of_unapproved_parent(self):

    en_revision = RevisionFactory(is_approved=False)
    es_document = DocumentFactory(locale='es', parent=en_revision.document)
    RevisionFactory(document=es_document, is_approved=True)
    es_revision = RevisionFactory(document=es_document, reviewed=None, is_approved=False, reviewer=None)
    self.client.login(username='admin', password='testpass')
    url = reverse('wiki.review_revision', args=[es_document.slug, es_revision.id])
    response = self.client.get(url, follow=True)
    eq_(200, response.status_code)
    doc = pq(response.content)
    eq_(3, len(doc('details')))
    eq_('Approved    English    version:', doc('#content-fields    h3').eq(0).text())
    rev_message = doc('#content-fields    p').eq(0).text()
    assert (('by    %s' % en_revision.creator.username) in rev_message)
