from django.conf.urls import url from contacts.views import (AddContact, UpdateContact, DeleteContact, ListContacts, SendActivationEmailView, UpdatePersonalInfo, ListContactsExport) urlpatterns = [ url(r'edit/$', AddContact.as_view(), name='contact_add'), url(r'edit/(?P<pk>\d+)/$', UpdateContact.as_view(), name='contact_update'), url(r'delete/(?P<pk>\d+)/$', DeleteContact.as_view(), name='contact_delete'), url(r'activate/(?P<pk>\d+)/$', SendActivationEmailView.as_view(), name='contact_claim_account'), url(r'personal/$', UpdatePersonalInfo.as_view(), name='personal_edit'), url(r'export_as_csv/$', ListContactsExport.as_view(), {'format': 'csv'}, name='contact_list_csv'), url(r'export_as_excel/$', ListContactsExport.as_view(), {'format': 'excel'}, name='contact_list_excel'), url(r'$', ListContacts.as_view(), name='contact_list'), ]
from django.conf.urls import url from contacts.views import ( AddContact, UpdateContact, DeleteContact, ListContacts, SendActivationEmailView, UpdatePersonalInfo, ListContactsExport ) urlpatterns = [ url(r'edit/$', AddContact.as_view(), name='contact_add'), url(r'edit/(?P<pk>\d+)/$', UpdateContact.as_view(), name='contact_update'), url(r'delete/(?P<pk>\d+)/$', DeleteContact.as_view(), name='contact_delete'), url(r'activate/(?P<pk>\d+)/$', SendActivationEmailView.as_view(), name='contact_claim_account'), url(r'personal/$', UpdatePersonalInfo.as_view(), name='personal_edit'), url(r'export_as_csv/$', ListContactsExport.as_view(), {'format': 'csv'}, name='contact_list_csv'), url(r'export_as_excel/$', ListContactsExport.as_view(), {'format': 'excel'}, name='contact_list_excel'), url(r'$', ListContacts.as_view(), name='contact_list'), ]
def test_has_expected_permissions_properties(self): view = DeleteContact() self.assertEqual(view.permission_required, 'contacts.delete_user') self.assertTrue(view.raise_exception)
from django.conf.urls import url from contacts.views import EditContact, AddContact, DeleteContact urlpatterns = [ url(r'^edit_contact/(?P<id_contact>\d{1,})/$', EditContact.as_view(), name='edit_contact'), url(r'^add_contact/$', AddContact.as_view(), name="add_contact"), url(r'^delete_contact/(?P<id_contact>\d{1,})/$', DeleteContact.as_view(), name="delete_contact"), ]