'When editing based on current revision, we should show a warning if
there are newer unapproved revisions.'

def _test_new_revision_warning(self, doc):

    created = (datetime.now() + timedelta(seconds=1))
    r = RevisionFactory(document=doc, created=created)
    response = self.client.get(reverse('wiki.edit_document', locale=doc.locale, args=[doc.slug]))
    assert len(pq(response.content)('.user-messages    .warning'))
    response = self.client.get(reverse('wiki.new_revision_based_on', locale=doc.locale, args=[doc.slug, r.id]))
    assert (not len(pq(response.content)('div.warning-box')))
    created = (created + timedelta(seconds=1))
    RevisionFactory(document=doc, created=created)
    response = self.client.get(reverse('wiki.new_revision_based_on', locale=doc.locale, args=[doc.slug, r.id]))
    assert len(pq(response.content)('.user-messages    .warning'))
