'Test the template for a banned user with revisions that can be marked as spam.'

def test_banned_user_revisions_ban_button(self):

    num_revisions = 3
    self.create_revisions(num=num_revisions, document=self.document, creator=self.testuser)
    UserBan.objects.create(user=self.testuser, by=self.admin, reason='Banned    by    unit    test.', is_active=True)
    self.client.login(username='admin', password='testpass')
    ban_url = reverse('users.ban_user_and_cleanup', kwargs={'username': self.testuser.username})
    resp = self.client.get(ban_url, follow=True)
    eq_(200, resp.status_code)
    page = pq(resp.content)
    revisions_found = page.find('.dashboard-row')
    ban_button = page.find('#ban-and-cleanup-form    button[type=submit]')
    ban_other_reasons = page.find('#ban-for-other-reasons')
    eq_(len(revisions_found), num_revisions)
    eq_(ban_button.text(), 'Submit    Spam')
    eq_(len(ban_other_reasons), 0)
