Exemple #1
0
 def test_organization_shown_in_header(self):
     request = self.factory.request()
     request.user = self.betty
     kwargs = {'organization_pk':self.bettysorg.id}
     response = OrganizationDetail(request=request, kwargs=kwargs).get(request, **kwargs)
     rendered_response = response.render() 
     self.assertRegexpMatches(rendered_response.content, "<h1>[\s\S]*%s[\s\S]*</h1>" % self.bettysorg)
Exemple #2
0
 def test_organization_shown_in_header(self):
     request = self.factory.request()
     request.user = self.betty
     kwargs = {'organization_pk': self.bettysorg.id}
     response = OrganizationDetail(request=request,
                                   kwargs=kwargs).get(request, **kwargs)
     rendered_response = response.render()
     self.assertRegexpMatches(rendered_response.content,
                              "<h1>[\s\S]*%s[\s\S]*</h1>" % self.bettysorg)
Exemple #3
0
    OrganizationList, OrganizationDetail, OrganizationUpdate,
    OrganizationDelete, OrganizationCreate, OrganizationUserList,
    OrganizationUserDetail, OrganizationUserUpdate, OrganizationUserCreate,
    OrganizationUserRemind, OrganizationUserDelete)

from organizations import views

urlpatterns = patterns(
    '',
    # Organization URLs
    url(r'^$', views.all_groups, name='all_groups'),
    url(r'^add/$',
        view=login_required(OrganizationCreate.as_view()),
        name="organization_add"),
    url(r'^(?P<organization_pk>[\d]+)/$',
        view=login_required(OrganizationDetail.as_view()),
        name="organization_detail"),
    url(r'^(?P<organization_pk>[\d]+)/edit/$',
        view=login_required(OrganizationUpdate.as_view()),
        name="organization_edit"),
    url(r'^(?P<organization_pk>[\d]+)/delete/$',
        view=login_required(OrganizationDelete.as_view()),
        name="organization_delete"),
    # url(r'^all/$', views.all_groups, name='all_groups' ),
    url(r'^(?P<organization_pk>[\d]+)/visit/$',
        views.user_not_member,
        name='user_not_member'),
    url(r'^(?P<organization_pk>[\d]+)/add/(?P<user_pk>[\d]+)$',
        views.add_user,
        name="organization_user_add"),
    url(r'^(?P<organization_pk>[\d]+)/delete/(?P<user_pk>[\d]+)$',
Exemple #4
0
from django.contrib.auth.decorators import login_required

from organizations.views import (OrganizationList, OrganizationDetail,
        OrganizationUpdate, OrganizationDelete, OrganizationCreate,
        OrganizationUserList, OrganizationUserDetail, OrganizationUserUpdate,
        OrganizationUserCreate, OrganizationUserRemind, OrganizationUserDelete)


urlpatterns = patterns('',
    # Organization URLs
    url(r'^$', view=login_required(OrganizationList.as_view()),
        name="organization_list"),
    url(r'^add/$', view=login_required(OrganizationCreate.as_view()),
        name="organization_add"),
    url(r'^(?P<organization_pk>[\d]+)/$',
        view=login_required(OrganizationDetail.as_view()),
        name="organization_detail"),
    url(r'^(?P<organization_pk>[\d]+)/edit/$',
        view=login_required(OrganizationUpdate.as_view()),
        name="organization_edit"),
    url(r'^(?P<organization_pk>[\d]+)/delete/$',
        view=login_required(OrganizationDelete.as_view()),
        name="organization_delete"),

    # Organization user URLs
    url(r'^(?P<organization_pk>[\d]+)/people/$',
        view=login_required(OrganizationUserList.as_view()),
        name="organization_user_list"),
    url(r'^(?P<organization_pk>[\d]+)/people/add/$',
        view=login_required(OrganizationUserCreate.as_view()),
        name="organization_user_add"),