def test_list_users(self): """ Tests data: List """ view = AdminUserListView.as_view() request = self.request_factory.get(reverse('admin_user_list')) request.user = self.user response = view(request) self.assertEqual(response.status_code, 200) self.assertEqual(response.context_data['object_list'].count(), 1) self.create_user() response = view(request) self.assertEqual(response.status_code, 200) self.assertEqual(response.context_data['object_list'].count(), 2)
def test_list_users(self): """ Tests data: List """ view = AdminUserListView.as_view() request = self.request_factory.get( reverse('admin_user_list') ) request.user = self.user response = view(request) self.assertEqual(response.status_code, 200) self.assertEqual(response.context_data['object_list'].count(), 1) self.create_user() response = view(request) self.assertEqual(response.status_code, 200) self.assertEqual(response.context_data['object_list'].count(), 2)
#Group url(r'^group/list/$', AdminGroupListView.as_view(), name='admin_group_list'), url(r'^group/create/$', AdminGroupCreateView.as_view(), name='admin_group_create'), url(r'^group/edit/(?P<pk>\d+)/$', AdminGroupEditView.as_view(), name='admin_group_edit'), url(r'^group/delete/$', AdminGroupDeleteView.as_view(), name='admin_group_delete'), #User url(r'^user/list/$', AdminUserListView.as_view(), name='admin_user_list'), url(r'^user/list/create/$', AdminUserCreateView.as_view(), name='admin_user_create'), url(r'^user/list/edit/(?P<pk>\d+)/$', AdminUserUpdateView.as_view(), name='admin_user_update'), url(r'^user/list/edit/(?P<pk>\d+)/status/$', AdminUserChangeStatusRedirectView.as_view(), name='admin_user_change_status'), url(r'^user/(?P<pk>\d+)/detail/group/$', AdminUserDetailView.as_view(), name='admin_user_group_detail'), url(r'^user/(?P<pk>\d+)/detail/permission/$', AdminUserPermissionDetailView.as_view(), name='admin_user_permission_detail'),
url(r'^group/create/$', AdminGroupCreateView.as_view(), name='admin_group_create'), url(r'^group/edit/(?P<pk>\d+)/$', AdminGroupEditView.as_view(), name='admin_group_edit'), url(r'^group/delete/$', AdminGroupDeleteView.as_view(), name='admin_group_delete'), #User url(r'^user/list/$', AdminUserListView.as_view(), name='admin_user_list'), url(r'^user/list/create/$', AdminUserCreateView.as_view(), name='admin_user_create'), url(r'^user/list/edit/(?P<pk>\d+)/$', AdminUserUpdateView.as_view(), name='admin_user_update'), url(r'^user/list/edit/(?P<pk>\d+)/status/$', AdminUserChangeStatusRedirectView.as_view(), name='admin_user_change_status'),