Ejemplo n.º 1
0
    def test_create_group(self):
        """
         Tests data: Create
         """
        self.assertEqual(Group.objects.all().count(), 2)
        data = {
            'name': 'groupTestCreate',
            'permission1': Permission.objects.get(pk=1).id,
            'permission2': Permission.objects.get(pk=2).id,
            'permission3': Permission.objects.get(pk=3).id
        }

        view = AdminGroupCreateView.as_view()
        request = self.request_factory.post(reverse('admin_group_create'),
                                            data)
        request.user = self.user
        response = view(request)
        self.assertEqual(response.status_code, 302)
        self.assertEqual(Group.objects.all().count(), 3)
        group = Group.objects.get(name='groupTestCreate')
        self.assertEqual(group.permissions.all().count(), 3)
Ejemplo n.º 2
0
    def test_create_group(self):
        """
         Tests data: Create
         """
        self.assertEqual(Group.objects.all().count(), 2)
        data = {
            'name': 'groupTestCreate',
            'permission1': Permission.objects.get(pk=1).id,
            'permission2': Permission.objects.get(pk=2).id,
            'permission3': Permission.objects.get(pk=3).id
        }

        view = AdminGroupCreateView.as_view()
        request = self.request_factory.post(
            reverse('admin_group_create'), data
        )
        request.user = self.user
        response = view(request)
        self.assertEqual(response.status_code, 302)
        self.assertEqual(Group.objects.all().count(), 3)
        group = Group.objects.get(name='groupTestCreate')
        self.assertEqual(group.permissions.all().count(), 3)
Ejemplo n.º 3
0
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(),
        name='admin_user_create'),
    url(r'^user/list/edit/(?P<pk>\d+)/$',
        AdminUserUpdateView.as_view(),
Ejemplo n.º 4
0
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'),