Beispiel #1
0
 def test_dasboard_request_is_successful(self, mock_get_create):
     mock_profile = Mock(spec=Profile)
     mock_user = utils.get_user_mock()
     mock_profile.user = mock_user
     mock_get_create.return_value = [mock_profile, False]
     request = utils.get_request('get', '/dashboard/', user=mock_user)
     response = views.dashboard(request)
     eq_(response.status_code, 200)
     eq_(response.template_name, 'people/dashboard.html')
     eq_(sorted(response.context_data.keys()),
         sorted(['application_list', 'content_list',
                 'featured_resource_list', 'hub_event_list',
                 'hub_list', 'hub_request_list', 'object',
                 'post_list', 'similar_applications']))
     mock_get_create.assert_called_once()
Beispiel #2
0
 def test_dashboard_requires_authentication(self):
     request = utils.get_request(
         'get', '/dashboard/', user=utils.get_anon_mock())
     response = views.dashboard(request)
     eq_(response['Location'], utils.get_login_url('/dashboard/'))