'Only 1 revision per document should be shown on the summary page.  All
revisions here are spam except for the original, so this document will
be reverted.'

@patch('kuma.wiki.forms.RevisionAkismetSubmissionSpamForm.is_valid')
def test_revisions_posted_same_doc(self, mock_form):

    mock_form.return_value = True
    revisions_created = self.create_revisions(num=3, document=self.document, creator=self.testuser)
    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 revisions_created]}
    resp = self.client.post(full_ban_url, data=data)
    eq_(200, resp.status_code)
    page = pq(resp.content)
    banned_user = page.find('#banned-user    li').text()
    revisions_reported_as_spam = page.find('#revisions-reported-as-spam    li')
    revisions_reverted = page.find('#revisions-reverted    li')
    revisions_deleted = page.find('#revisions-deleted    li')
    eq_(banned_user, self.testuser.username)
    eq_(len(revisions_reported_as_spam), 1)
    eq_(len(revisions_reverted), 1)
    eq_(len(revisions_deleted), 0)
    not_submitted_to_akismet = page.find('#not-submitted-to-akismet    li')
    could_not_delete = page.find('#not-deleted    li')
    could_not_revert = page.find('#not-reverted    li')
    eq_(len(not_submitted_to_akismet), 0)
    eq_(len(could_not_delete), 0)
    eq_(len(could_not_revert), 0)
    already_spam = page.find('#already-spam    li')
    not_spam = page.find('#not-spam    li')
    eq_(len(already_spam), 0)
    eq_(len(not_spam), 0)
