Esempio n. 1
0
 def test_update_state_user(self):
     self.assertEqual(self.user.is_active, True)
     url_kwargs = {'pk': self.user.id}
     url = reverse('admin_user_change_status', kwargs=url_kwargs)
     request = self.request_factory.get(url)
     request.user = self.user
     view = AdminUserChangeStatusRedirectView.as_view()
     response = view(request, pk=self.user.id)
     user = User.objects.get(is_superuser=True)
     self.assertEqual(user.is_active, False)
     self.assertEqual(response.status_code, 302)
Esempio n. 2
0
 def test_update_state_user(self):
     self.assertEqual(self.user.is_active, True)
     url_kwargs = {'pk': self.user.id}
     url = reverse('admin_user_change_status', kwargs=url_kwargs)
     request = self.request_factory.get(url)
     request.user = self.user
     view = AdminUserChangeStatusRedirectView.as_view()
     response = view(request, pk=self.user.id)
     user = User.objects.get(is_superuser=True)
     self.assertEqual(user.is_active, False)
     self.assertEqual(response.status_code, 302)
Esempio n. 3
0
        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'^user/(?P<pk>\d+)/detail/group/delete/$',
        AdminUserGroupDeleteView.as_view(),
        name='admin_user_group_delete'),

    #Support
    url(r'^user/support/$',
        AdminSupportListView.as_view(),
        name='admin_user_support_list'),
Esempio n. 4
0
                       #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'^user/(?P<pk>\d+)/detail/group/delete/$',
                           AdminUserGroupDeleteView.as_view(),
                           name='admin_user_group_delete'),

                    #Support