'Test with a spam user who has made revisions to a single document,
but another user has made a revision in between those.'

def test_intermediate_non_spam_rev(self):

    bottom_spam = self.create_revisions(num=1, document=self.document, creator=self.testuser)
    self.create_revisions(num=1, document=self.document, creator=self.admin)
    top_spam = self.create_revisions(num=1, document=self.document, creator=self.testuser)
    spam_revisions = (bottom_spam + top_spam)
    self.client.login(username='admin', password='testpass')
    ban_url = reverse('users.ban_user_and_cleanup_summary', kwargs={'username': self.testuser.username})
    full_ban_url = self.client.get(ban_url)['Location']
    data = {'revision-id': [rev.id for rev in spam_revisions]}
    resp = self.client.post(full_ban_url, data=data)
    eq_(200, resp.status_code)
    page = pq(resp.content)
    revisions_deleted = page.find('#revisions-deleted    li')
    revisions_reverted = page.find('#revisions-reverted    li')
    eq_(len(revisions_deleted), 0)
    eq_(len(revisions_reverted), 1)
    revisions_added_afterwards = page.find('#new-actions-by-user    li')
    revisions_skipped = page.find('#skipped-revisions    li')
    revisions_reported_as_spam = page.find('#revisions-reported-as-spam    li')
    eq_(len(revisions_added_afterwards), 0)
    eq_(len(revisions_skipped), 1)
    eq_(len(revisions_reported_as_spam), 1)
    revisions_not_reverted = page.find('#latest-revision-non-spam    li')
    revisions_already_spam = page.find('#already-spam    li')
    revisions_not_spam = page.find('#not-spam    li')
    eq_(len(revisions_not_reverted), 0)
    eq_(len(revisions_already_spam), 0)
    eq_(len(revisions_not_spam), 0)
