'The ban permission controls access to the ban and cleanup view.'

def test_ban_permission(self):

    admin = self.user_model.objects.get(username='admin')
    testuser = self.user_model.objects.get(username='testuser')
    self.client.login(username='testuser', password='testpass')
    ban_url = reverse('users.ban_user_and_cleanup', kwargs={'username': admin.username})
    resp = self.client.get(ban_url)
    eq_(302, resp.status_code)
    ok_((str(settings.LOGIN_URL) in resp['Location']))
    self.client.logout()
    self.client.login(username='admin', password='testpass')
    ban_url = reverse('users.ban_user_and_cleanup', kwargs={'username': testuser.username})
    resp = self.client.get(ban_url)
    eq_(200, resp.status_code)
