Beispiel #1
0
 def test_get_request_is_successful(self):
     user = fixtures.get_user('us-ignite')
     fixtures.get_profile(user=user, slug='someone', name='us ignite')
     response = views.profile_detail(self._get_request(), 'someone')
     ok_(response.status_code, 200)
     eq_(sorted(response.context_data.keys()),
         sorted(['object', 'application_list', 'event_list',
                 'resource_list', 'hub_list',
                 'hub_request_list', 'organization_list', 'award_list',
                 'is_owner']))
     _teardown_profiles()
Beispiel #2
0
 def test_profile_detail_requires_authentication(self):
     request = self.factory.get('/people/someone/')
     request.user = utils.get_anon_mock()
     response = views.profile_detail(request)
     eq_(response.status_code, 302)
     eq_(response['Location'], utils.get_login_url('/people/someone/'))