'A banned user should not be viewable'

def test_bug_811751_banned_user(self):

    testuser = self.user_model.objects.get(username='testuser')
    url = reverse('users.user_detail', args=(testuser.username,))
    response = self.client.get(url, follow=True)
    self.assertNotEqual(response.status_code, 403)
    admin = self.user_model.objects.get(username='admin')
    testuser = self.user_model.objects.get(username='testuser')
    UserBan.objects.create(user=testuser, by=admin, reason='Banned    by    unit    test.', is_active=True)
    response = self.client.get(url, follow=True)
    self.assertEqual(response.status_code, 404)
    self.client.login(username='admin', password='testpass')
    response = self.client.get(url, follow=True)
    self.assertNotEqual(response.status_code, 404)
