Esempio n. 1
0
    def _test_list_view_project_filter_casting(self):
        """
        Tests data: Filter
        """
        request = self.request_factory.get(reverse('project_list'),
                                           data={'line_productions': Project.LINE_CASTING})
        request.user = self.user
        view = ProjectListView.as_view()
        response = view(request)

        self.assertEquals(response.status_code, 200)
        self.assertEquals(len(response.context_data['project_list']), 4)
Esempio n. 2
0
    def _test_list_view_project_filter_casting(self):
        """
        Tests data: Filter
        """
        request = self.request_factory.get(
            reverse('project_list'),
            data={'line_productions': Project.LINE_CASTING})
        request.user = self.user
        view = ProjectListView.as_view()
        response = view(request)

        self.assertEquals(response.status_code, 200)
        self.assertEquals(len(response.context_data['project_list']), 4)
Esempio n. 3
0
 def _test_list_view_project_filter_range_dates(self):
     """
     Tests data: Filter
     """
     self.insert_project()
     request = self.request_factory.get(reverse('project_list'),
                                        data={'start_date__gte': '01/07/2014',
                                              'finish_date__lte': '02/07/2014'})
     request.user = self.user
     view = ProjectListView.as_view()
     response = view(request)
     self.assertEquals(response.status_code, 200)
     self.assertEquals(len(response.context_data['project_list']), 1)
Esempio n. 4
0
    def _test_list_view_project(self):
        """
        Tests data: List
        """
        view = ProjectListView.as_view()
        request = self.request_factory.get(reverse('project_list'))
        request.user = self.user
        response = view(request)
        self.assertEqual(response.status_code, 200)
        self.assertEqual(response.context_data['object_list'].count(), 4)

        self.insert_project()
        response = view(request)
        self.assertEqual(response.context_data['object_list'].count(), 5)
Esempio n. 5
0
 def _test_list_view_project_filter_range_dates(self):
     """
     Tests data: Filter
     """
     self.insert_project()
     request = self.request_factory.get(reverse('project_list'),
                                        data={
                                            'start_date__gte': '01/07/2014',
                                            'finish_date__lte': '02/07/2014'
                                        })
     request.user = self.user
     view = ProjectListView.as_view()
     response = view(request)
     self.assertEquals(response.status_code, 200)
     self.assertEquals(len(response.context_data['project_list']), 1)
Esempio n. 6
0
    def _test_list_view_project(self):
        """
        Tests data: List
        """
        view = ProjectListView.as_view()
        request = self.request_factory.get(
            reverse('project_list')
        )
        request.user = self.user
        response = view(request)
        self.assertEqual(response.status_code, 200)
        self.assertEqual(response.context_data['object_list'].count(), 4)

        self.insert_project()
        response = view(request)
        self.assertEqual(response.context_data['object_list'].count(), 5)
Esempio n. 7
0
from apps.sp.views.panel.Project import (
    ProjectListView,
    ProjectCreateView,
    ProjectRolesJsonView,
    ProjectSaveJsonView,
    ProjectLinesJsonView,
    ProjectUpdateJsonView,
    ProjectDataUpdateJsonView,
    DetailModelJsonView,
    ProjectFinishRedirectView,
    ProjectStartRedirectView,
    ProjectDeleteRedirectView,
    PautaDetailModelJsonView,
)

urlpatterns = patterns(
    "",
    url(r"^$", ProjectListView.as_view(), name="project_list"),
    url(r"^update-finish/(?P<pk>\d+)/$", ProjectFinishRedirectView.as_view(), name="project_change_finish"),
    url(r"^update-start/(?P<pk>\d+)/$", ProjectStartRedirectView.as_view(), name="project_change_start"),
    url(r"^delete/(?P<pk>\d+)/$", ProjectDeleteRedirectView.as_view(), name="project_delete"),
    url(r"^create/(?P<pk>[^/]+)/$", ProjectCreateView.as_view(), name="project_crud"),
    url(r"^roles/$", ProjectRolesJsonView.as_view(), name="project_roles_json"),
    url(r"^save/$", ProjectSaveJsonView.as_view(), name="project_save"),
    url(r"^update/$", ProjectUpdateJsonView.as_view(), name="project_update"),
    url(r"^data-update/(?P<pk>[^/]+)/$", ProjectDataUpdateJsonView.as_view(), name="project_update_data_json"),
    url(r"^line-json/$", ProjectLinesJsonView.as_view(), name="project_line_json"),
    url(r"^detail-model-json/(?P<pk>[^/]+)/$", DetailModelJsonView.as_view(), name="detail_model_json"),
    url(r"^pauta-detail-json/(?P<pk>[^/]+)/$", PautaDetailModelJsonView.as_view(), name="pauta_detail_model_json"),
)
Esempio n. 8
0
# -*- coding: utf-8 -*-

from django.conf.urls import url, patterns
from apps.sp.views.panel.Project import ProjectListView,\
    ProjectCreateView, ProjectRolesJsonView, ProjectSaveJsonView, \
    ProjectLinesJsonView, ProjectUpdateJsonView, ProjectDataUpdateJsonView, \
    DetailModelJsonView, ProjectFinishRedirectView, ProjectStartRedirectView, \
    ProjectDeleteRedirectView, PautaDetailModelJsonView

urlpatterns = patterns(
    '',
    url(r'^$', ProjectListView.as_view(), name='project_list'),
    url(r'^update-finish/(?P<pk>\d+)/$',
        ProjectFinishRedirectView.as_view(),
        name='project_change_finish'),
    url(r'^update-start/(?P<pk>\d+)/$',
        ProjectStartRedirectView.as_view(),
        name='project_change_start'),
    url(r'^delete/(?P<pk>\d+)/$',
        ProjectDeleteRedirectView.as_view(),
        name='project_delete'),
    url(r'^create/(?P<pk>[^/]+)/$',
        ProjectCreateView.as_view(),
        name='project_crud'),
    url(r'^roles/$', ProjectRolesJsonView.as_view(),
        name='project_roles_json'),
    url(r'^save/$', ProjectSaveJsonView.as_view(), name='project_save'),
    url(r'^update/$', ProjectUpdateJsonView.as_view(), name='project_update'),
    url(r'^data-update/(?P<pk>[^/]+)/$',
        ProjectDataUpdateJsonView.as_view(),
        name='project_update_data_json'),