Ejemplo n.º 1
0
    def test_delete_view_brand(self):
        """
        Tests data: Delete
        """
        studio = Studio()
        studio.name = 'studio test'
        studio.save()
        studio = Studio.objects.get(pk=1)
        self.assertEqual(Studio.objects.all().count(), 1)

        kwargs = {'pk': studio.id}
        url = reverse('studio_delete', kwargs=kwargs)
        request = self.request_factory.post(url, kwargs)
        request.user = self.user
        response = StudioDeleteView.as_view()(request, **kwargs)
        self.assertEqual(response.status_code, 302)
        self.assertEqual(Studio.objects.all().count(), 0)
Ejemplo n.º 2
0
# -*- coding: utf-8 -*-

from django.conf.urls import url, patterns
from apps.sp.views.panel.Studio import StudioListView, StudioCreateView, \
    StudioUpdateView, StudioDeleteView


urlpatterns = patterns('',
                       #Studio
                       url(r'^list/$',
                           StudioListView.as_view(),
                           name='studio_list'),
                       url(r'^create/$',
                           StudioCreateView.as_view(),
                           name='studio_create'),
                       url(r'^edit/(?P<pk>\d+)/$',
                           StudioUpdateView.as_view(),
                           name='studio_edit'),
                       url(r'^delete/(?P<pk>\d+)/$',
                           StudioDeleteView.as_view(),
                           name='studio_delete')
                       )
Ejemplo n.º 3
0
# -*- coding: utf-8 -*-

from django.conf.urls import url, patterns
from apps.sp.views.panel.Studio import StudioListView, StudioCreateView, \
    StudioUpdateView, StudioDeleteView

urlpatterns = patterns(
    '',
    #Studio
    url(r'^list/$', StudioListView.as_view(), name='studio_list'),
    url(r'^create/$', StudioCreateView.as_view(), name='studio_create'),
    url(r'^edit/(?P<pk>\d+)/$', StudioUpdateView.as_view(),
        name='studio_edit'),
    url(r'^delete/(?P<pk>\d+)/$',
        StudioDeleteView.as_view(),
        name='studio_delete'))