Beispiel #1
0
 def test_inactive_users_are_not_listed(self):
     user = fixtures.get_user('us-ignite', is_active=False)
     fixtures.get_profile(user=user, name='us ignite')
     response = views.profile_list(self._get_request())
     eq_(response.status_code, 200)
     eq_(len(response.context_data['page'].object_list), 0)
     _teardown_profiles()
Beispiel #2
0
 def test_users_can_be_reverse_sorted(self):
     user_a = fixtures.get_user('alpha')
     profile_a = fixtures.get_profile(user=user_a, name='alpha')
     user_b = fixtures.get_user('beta')
     profile_b = fixtures.get_profile(user=user_b, name='beta')
     request = self._get_request(data={'order': '-user__first_name'})
     response = views.profile_list(request)
     eq_(list(response.context_data['page'].object_list),
         [profile_b, profile_a])
     _teardown_profiles()
Beispiel #3
0
 def test_authenticated_profile_list_is_successful(self):
     request = self._get_request()
     response = views.profile_list(request)
     eq_(response.status_code, 200)
     eq_(len(response.context_data['page'].object_list), 0)
Beispiel #4
0
 def test_authenticated_profile_list_context(self):
     response = views.profile_list(self._get_request())
     eq_(response.status_code, 200)
     eq_(sorted(response.context_data.keys()),
         ['order', 'order_form', 'page'])
Beispiel #5
0
 def test_profile_list_requires_authentication(self):
     request = self.factory.get('/people/')
     request.user = utils.get_anon_mock()
     response = views.profile_list(request)
     eq_(response.status_code, 302)
     eq_(response['Location'], utils.get_login_url('/people/'))