Example #1
0
 def test_permission_dashboard(self):
     #SuperAdmin
     view = SettingsTemplateView.as_view()
     request = self.request_factory.get(reverse('admin_settings'))
     request.user = self.user
     response = view(request)
     self.assertEqual(response.status_code, 200)
     #Other User
     self.create_user()
     request.user = self.user
     setattr(request, 'session', 'session')
     messages = FallbackStorage(request)
     setattr(request, '_messages', messages)
     response = view(request)
     self.assertEqual(response.status_code, 302)
Example #2
0
 def test_permission_dashboard(self):
     #SuperAdmin
     view = SettingsTemplateView.as_view()
     request = self.request_factory.get(
         reverse('admin_settings')
     )
     request.user = self.user
     response = view(request)
     self.assertEqual(response.status_code, 200)
     #Other User
     self.create_user()
     request.user = self.user
     setattr(request, 'session', 'session')
     messages = FallbackStorage(request)
     setattr(request, '_messages', messages)
     response = view(request)
     self.assertEqual(response.status_code, 302)
Example #3
0
from apps.sp.views.panel.admin.Group import AdminGroupListView, \
    AdminGroupCreateView, AdminGroupEditView, AdminGroupDeleteView

from apps.sp.views.panel.admin.User import AdminUserListView,\
    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'),
Example #4
0
from apps.sp.views.panel.admin.Group import AdminGroupListView, \
    AdminGroupCreateView, AdminGroupEditView, AdminGroupDeleteView

from apps.sp.views.panel.admin.User import AdminUserListView,\
    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'),