示例#1
0
 def test_list_groups(self):
     view = AdminGroupListView.as_view()
     request = self.request_factory.get(reverse('admin_group_list'))
     request.user = self.user
     response = view(request)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.context_data['object_list'].count(), 2)
     self.create_group()
     response = view(request)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.context_data['object_list'].count(), 3)
示例#2
0
 def test_list_groups(self):
     view = AdminGroupListView.as_view()
     request = self.request_factory.get(
         reverse('admin_group_list')
     )
     request.user = self.user
     response = view(request)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.context_data['object_list'].count(), 2)
     self.create_group()
     response = view(request)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.context_data['object_list'].count(), 3)
示例#3
0
    AdminUserDetailView, AdminUserGroupDeleteView, AdminUserPermissionDetailView, \
    AdminUserCreateView, AdminUserUpdateView, AdminUserChangeStatusRedirectView

from apps.sp.views.panel.admin.Support import AdminSupportListView
from apps.sp.views.panel.admin.Support import AdminSupportReportView
from apps.sp.views.panel.admin.Support import AdminSupportCompleteRedirectView

from apps.sp.views.panel.Dashboard import SettingsTemplateView

urlpatterns = patterns(
    '',
    url(r'^settings/$', SettingsTemplateView.as_view(), name='admin_settings'),

    #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(),
示例#4
0
    AdminUserCreateView, AdminUserUpdateView, AdminUserChangeStatusRedirectView

from apps.sp.views.panel.admin.Support import AdminSupportListView
from apps.sp.views.panel.admin.Support import AdminSupportReportView
from apps.sp.views.panel.admin.Support import AdminSupportCompleteRedirectView

from apps.sp.views.panel.Dashboard import SettingsTemplateView

urlpatterns = patterns('',
                       url(r'^settings/$',
                           SettingsTemplateView.as_view(),
                           name='admin_settings'),

                       #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