def test_list(self):
    url = reverse('profiles.user_list')
    response = self.url_get('unicef', url)
    self.assertLoginRedirect(response, 'unicef', url)
    self.login(self.user1)
    response = self.url_get('unicef', url)
    self.assertLoginRedirect(response, 'unicef', url)
    self.login(self.admin)
    response = self.url_get('unicef', url)
    self.assertEqual(response.status_code, 200)
    self.assertEqual(len(response.context['object_list']), 2)
def test_list(self):
    url = reverse('profiles.user_list')
    response = self.url_get('unicef', url)
    self.assertLoginRedirect(response, 'unicef', url)
    self.login(self.user1)
    response = self.url_get('unicef', url)
    self.assertLoginRedirect(response, 'unicef', url)
    self.login(self.admin)
    response = self.url_get('unicef', url)
    self.assertEqual(response.status_code, 200)
    self.assertEqual(len(response.context['object_list']), 2)