コード例 #1
0
    def test_per_instance_api_docs(self):
        url = reverse('writeitinstance_api_docs', subdomain=self.writeitinstance.slug)
        request = self.factory.get(url)
        request.user = self.writeitinstance.owner

        response = WriteItInstanceApiDocsView.as_view()(request, pk=self.writeitinstance.pk)
        self.assertContains(response, 'api/v1/message/?format=json&username=admin&api_key=')
コード例 #2
0
    def test_per_instance_api_docs(self):
        url = reverse('writeitinstance_api_docs',
                      subdomain=self.writeitinstance.slug)
        request = self.factory.get(url)
        request.user = self.writeitinstance.owner

        response = WriteItInstanceApiDocsView.as_view()(
            request, pk=self.writeitinstance.pk)
        self.assertContains(
            response, 'api/v1/message/?format=json&username=admin&api_key=')
コード例 #3
0
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
download_attachment_view = ObjectDownloadView.as_view(model=AnswerAttachment, file_field="content")

managepatterns = patterns('',
    url(r'^$', WriteItInstanceUpdateView.as_view(), name='writeitinstance_basic_update'),
    url(r'^settings/moderation/$', WriteItInstanceModerationView.as_view(), name='writeitinstance_moderation_update'),
    url(r'^moderationqueue/$', ModerationQueue.as_view(), name='writeitinstance_moderation_queue'),
    url(r'^recipients/settings/$', WriteItInstanceRecipientsSettingsView.as_view(), name='writeitinstance_recipients_settings_update'),
    url(r'^settings/ratelimiter/$', WriteItInstanceRateLimiterView.as_view(), name='writeitinstance_ratelimiter_update'),
    url(r'^messages/settings/$', WriteItInstanceAnswerNotificationView.as_view(), name='writeitinstance_answernotification_update'),
    url(r'^api/settings/$', WriteItInstanceApiAutoconfirmView.as_view(), name='writeitinstance_api_autoconfirm_update'),
    url(r'^settings/webbased/$', WriteItInstanceWebBasedView.as_view(), name='writeitinstance_webbased_update'),
    url(r'^settings/api/$', WriteItInstanceApiDocsView.as_view(), name='writeitinstance_api_docs'),
    url(r'^settings/webhooks/$', WriteItInstanceWebHooksView.as_view(), name='writeitinstance_webhooks'),
    url(r'^settings/create_webhooks/$', WriteItInstanceCreateWebHooksView.as_view(), name='writeitinstance_create_webhooks'),
    url(r'^settings/sources/$', WriteitPopitRelatingView.as_view(), name='relate-writeit-popit'),
    url(r'^settings/sources/resync/(?P<popolo_source_pk>[-\d]+)/$', ReSyncFromPopit.as_view(), name='resync-from-popit'),
    url(r'^settings/sources/update/(?P<pk>[-\d]+)/$', WriteItPopitUpdateView.as_view(), name='update-popit-writeit-relation'),
    url(r'^settings/templates/$', WriteItInstanceTemplateUpdateView.as_view(), name='writeitinstance_template_update'),
    url(r'^settings/templates/new_answer_notification/$', NewAnswerNotificationTemplateUpdateView.as_view(), name='edit_new_answer_notification_template'),
    url(r'^settings/templates/confirmation_template/$', ConfirmationTemplateUpdateView.as_view(), name='edit_confirmation_template'),
    url(r'^settings/templates/mailit_template/$', MailitTemplateUpdateView.as_view(), name='mailit-template-update'),
    url(r'^recipients/toggle-enabled/$',
        ToggleContactEnabledView.as_view(),
        name='toggle-enabled'),
    url(r'^recipients/$', WriteItInstanceContactDetailView.as_view(), name='contacts-per-writeitinstance'),
    url(r'^messages/$', MessagesPerWriteItInstance.as_view(), name='messages_per_writeitinstance'),
    url(r'^messages/(?P<pk>[-\d]+)/answers/$', MessageDetail.as_view(), name='message_detail_private'),
コード例 #4
0
     WriteItInstanceRecipientsSettingsView.as_view(),
     name='writeitinstance_recipients_settings_update'),
 url(r'^settings/ratelimiter/$',
     WriteItInstanceRateLimiterView.as_view(),
     name='writeitinstance_ratelimiter_update'),
 url(r'^messages/settings/$',
     WriteItInstanceAnswerNotificationView.as_view(),
     name='writeitinstance_answernotification_update'),
 url(r'^api/settings/$',
     WriteItInstanceApiAutoconfirmView.as_view(),
     name='writeitinstance_api_autoconfirm_update'),
 url(r'^settings/webbased/$',
     WriteItInstanceWebBasedView.as_view(),
     name='writeitinstance_webbased_update'),
 url(r'^settings/api/$',
     WriteItInstanceApiDocsView.as_view(),
     name='writeitinstance_api_docs'),
 url(r'^settings/webhooks/$',
     WriteItInstanceWebHooksView.as_view(),
     name='writeitinstance_webhooks'),
 url(r'^settings/create_webhooks/$',
     WriteItInstanceCreateWebHooksView.as_view(),
     name='writeitinstance_create_webhooks'),
 url(r'^settings/sources/$',
     WriteitPopitRelatingView.as_view(),
     name='relate-writeit-popit'),
 url(r'^settings/sources/resync/(?P<popolo_source_pk>[-\d]+)/$',
     ReSyncFromPopit.as_view(),
     name='resync-from-popit'),
 url(r'^settings/sources/update/(?P<pk>[-\d]+)/$',
     WriteItPopitUpdateView.as_view(),
コード例 #5
0
ファイル: subdomain_urls.py プロジェクト: mysociety/write-it
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
download_attachment_view = ObjectDownloadView.as_view(model=AnswerAttachment, file_field="content")

managepatterns = patterns('',
    url(r'^$', WriteItInstanceUpdateView.as_view(), name='writeitinstance_basic_update'),
    url(r'^settings/moderation/$', WriteItInstanceModerationView.as_view(), name='writeitinstance_moderation_update'),
    url(r'^moderationqueue/$', ModerationQueue.as_view(), name='writeitinstance_moderation_queue'),
    url(r'^recipients/settings/$', WriteItInstanceRecipientsSettingsView.as_view(), name='writeitinstance_recipients_settings_update'),
    url(r'^settings/ratelimiter/$', WriteItInstanceRateLimiterView.as_view(), name='writeitinstance_ratelimiter_update'),
    url(r'^messages/settings/$', WriteItInstanceAnswerNotificationView.as_view(), name='writeitinstance_answernotification_update'),
    url(r'^api/settings/$', WriteItInstanceApiAutoconfirmView.as_view(), name='writeitinstance_api_autoconfirm_update'),
    url(r'^settings/webbased/$', WriteItInstanceWebBasedView.as_view(), name='writeitinstance_webbased_update'),
    url(r'^settings/api/$', WriteItInstanceApiDocsView.as_view(), name='writeitinstance_api_docs'),
    url(r'^settings/webhooks/$', WriteItInstanceWebHooksView.as_view(), name='writeitinstance_webhooks'),
    url(r'^settings/create_webhooks/$', WriteItInstanceCreateWebHooksView.as_view(), name='writeitinstance_create_webhooks'),
    url(r'^settings/sources/$', WriteitPopitRelatingView.as_view(), name='relate-writeit-popit'),
    url(r'^settings/sources/resync/(?P<popolo_source_pk>[-\d]+)/$', ReSyncFromPopit.as_view(), name='resync-from-popit'),
    url(r'^settings/sources/update/(?P<pk>[-\d]+)/$', WriteItPopitUpdateView.as_view(), name='update-popit-writeit-relation'),
    url(r'^settings/templates/$', WriteItInstanceTemplateUpdateView.as_view(), name='writeitinstance_template_update'),
    url(r'^settings/templates/new_answer_notification/$', NewAnswerNotificationTemplateUpdateView.as_view(), name='edit_new_answer_notification_template'),
    url(r'^settings/templates/confirmation_template/$', ConfirmationTemplateUpdateView.as_view(), name='edit_confirmation_template'),
    url(r'^settings/templates/mailit_template/$', MailitTemplateUpdateView.as_view(), name='mailit-template-update'),
    url(r'^recipients/toggle-enabled/$',
        ToggleContactEnabledView.as_view(),
        name='toggle-enabled'),
    url(r'^recipients/$', WriteItInstanceContactDetailView.as_view(), name='contacts-per-writeitinstance'),
    url(r'^messages/$', MessagesPerWriteItInstance.as_view(), name='messages_per_writeitinstance'),
    url(r'^messages/(?P<pk>[-\d]+)/answers/$', MessageDetail.as_view(), name='message_detail_private'),