'POSTing to ban_user_and_cleanup url with revisions to 2 documents.'

def test_post_one_reverts_one_does_not_revert(self):

    new_document_a = create_document(save=True)
    new_document_b = create_document(save=True)
    self.create_revisions(num=1, document=new_document_a, creator=self.admin)
    self.create_revisions(num=1, document=new_document_b, creator=self.admin)
    spam_revisions_a = self.create_revisions(num=3, document=new_document_a, creator=self.testuser)
    safe_revision_a = self.create_revisions(num=1, document=new_document_a, creator=self.admin)
    spam_revisions_b = self.create_revisions(num=3, document=new_document_b, creator=self.testuser)
    data = {'revision-id': [rev.id for rev in (spam_revisions_a + spam_revisions_b)]}
    self.client.login(username='admin', password='testpass')
    resp = self.client.post(self.ban_testuser_url, data=data)
    eq_(200, resp.status_code)
    new_document_a = Document.objects.filter(id=new_document_a.id).first()
    eq_(new_document_a.current_revision.id, safe_revision_a[0].id)
    revisions_a = Revision.objects.filter(document=new_document_a)
    eq_(revisions_a.count(), 5)
    new_document_b = Document.objects.filter(id=new_document_b.id).first()
    for revision in spam_revisions_b:
        ok_((revision.id != new_document_b.current_revision.id))
    latest_revision_b = Revision.objects.filter(document=new_document_b).order_by('-id').first()
    eq_(new_document_b.current_revision.id, latest_revision_b.id)
    eq_(new_document_b.current_revision.creator, self.admin)
    revisions_b = Revision.objects.filter(document=new_document_b)
    eq_(revisions_b.count(), 5)
