def test_login_required_to_access_view(self): actionitem = G(ActionItem) get_request = RequestFactory().get('/') get_request.user = AnonymousUser() response = EconsensusActionitemDetailView.as_view()(get_request, pk=actionitem.pk) self.assertEqual(response.status_code, 302) actionitem.delete()
def test_action_item_detail_view_doesnt_use_item_detail_template(self): actionitem = G(ActionItem) get_request = RequestFactory().get('/') get_request.user = self.betty response = EconsensusActionitemDetailView.as_view()(get_request, pk=actionitem.pk) self.assertNotIn('item_detail.html', response.template_name) actionitem.delete()
url(r'^item/detail/(?P<pk>[\d]+)/$', DecisionDetail.as_view(template_name = 'item_detail.html'), name='publicweb_item_detail'), url(r'^(?P<org_slug>[-\w]+)/item/list/(?P<status>[a-z]+)/$', DecisionList.as_view(template_name='decision_list.html'), name='publicweb_item_list'), url(r'^(?P<org_slug>[-\w]+)/search/$', DecisionSearchView.make(), name='publicweb_decision_search'), #actionitem urls url(r'^item/detail/(?P<pk>[\d]+)/actionitem/add/$', EconsensusActionitemCreateView.as_view(), name='actionitem_create'), url(r'^item/detail/(?P<decisionpk>[\d]+)/actionitem/(?P<pk>[\d]+)/$', EconsensusActionitemDetailView.as_view(), name='actionitem_detail'), url(r'^item/detail/(?P<decisionpk>[\d]+)/actionitem/(?P<pk>[\d]+)/update/$', EconsensusActionitemUpdateView.as_view(), name='actionitem_update'), url(r'^(?P<org_slug>[-\w]+)/actionitem/list/$', EconsensusActionitemListView.as_view(), name='actionitem_list'), url(r'^(?P<org_slug>[-\w]+)/item/list/$', DecisionList.as_view(template_name='decision_list.html'), name='publicweb_default_item_list'), url(r'^$', OrganizationRedirectView.as_view(), name='publicweb_root'), )
#item urls url(r'^item/detail/(?P<pk>[\d]+)/$', DecisionDetail.as_view(template_name='item_detail.html'), name='publicweb_item_detail'), url(r'^(?P<org_slug>[-\w]+)/item/list/(?P<status>[a-z]+)/$', DecisionList.as_view(template_name='decision_list.html'), name='publicweb_item_list'), url(r'^(?P<org_slug>[-\w]+)/search/$', DecisionSearchView.make(), name='publicweb_decision_search'), #actionitem urls url(r'^item/detail/(?P<pk>[\d]+)/actionitem/add/$', EconsensusActionitemCreateView.as_view(), name='actionitem_create'), url(r'^item/detail/(?P<decisionpk>[\d]+)/actionitem/(?P<pk>[\d]+)/$', EconsensusActionitemDetailView.as_view(), name='actionitem_detail'), url(r'^item/detail/(?P<decisionpk>[\d]+)/actionitem/(?P<pk>[\d]+)/update/$', EconsensusActionitemUpdateView.as_view(), name='actionitem_update'), url(r'^(?P<org_slug>[-\w]+)/actionitem/list/$', EconsensusActionitemListView.as_view(), name='actionitem_list'), url(r'^(?P<org_slug>[-\w]+)/item/list/$', DecisionList.as_view(template_name='decision_list.html'), name='publicweb_default_item_list'), url(r'^$', OrganizationRedirectView.as_view(), name='publicweb_root'), )