def test_get_to_url(self):
        '''Get the delete a WriteItInstance url returns a check if deleting'''
        url = reverse('delete_an_instance', subdomain=self.writeitinstance.slug)
        request = self.factory.get(url)
        request.user = self.writeitinstance.owner
        response = WriteItDeleteView.as_view()(request)

        self.assertEquals(response.status_code, 200)
        self.assertTemplateUsed(response, 'nuntium/profiles/writeitinstance_check_delete.html')
        # It's not yet deleted
        self.assertTrue(WriteItInstance.objects.get(id=self.writeitinstance.id))
    def test_post_to_url(self):
        '''When I post to the URL then it deletes the writeitinstance'''
        url = reverse('delete_an_instance', subdomain=self.writeitinstance.slug)
        request = self.factory.post(url)
        request.user = self.writeitinstance.owner
        response = WriteItDeleteView.as_view()(request)
        # Now it should be deleted
        self.assertFalse(WriteItInstance.objects.filter(id=self.writeitinstance.id))

        your_instances_url = reverse('your-instances')
        self.assertTrue(response)
        self.assertEquals(response.status_code, 302)
        self.assertEquals(response.url, your_instances_url)
    def test_get_to_url(self):
        '''Get the delete a WriteItInstance url returns a check if deleting'''
        url = reverse('delete_an_instance',
                      subdomain=self.writeitinstance.slug)
        request = self.factory.get(url)
        request.user = self.writeitinstance.owner
        response = WriteItDeleteView.as_view()(request)

        self.assertEquals(response.status_code, 200)
        self.assertTemplateUsed(
            response, 'nuntium/profiles/writeitinstance_check_delete.html')
        # It's not yet deleted
        self.assertTrue(
            WriteItInstance.objects.get(id=self.writeitinstance.id))
    def test_post_to_url(self):
        '''When I post to the URL then it deletes the writeitinstance'''
        url = reverse('delete_an_instance',
                      subdomain=self.writeitinstance.slug)
        request = self.factory.post(url)
        request.user = self.writeitinstance.owner
        response = WriteItDeleteView.as_view()(request)
        # Now it should be deleted
        self.assertFalse(
            WriteItInstance.objects.filter(id=self.writeitinstance.id))

        your_instances_url = reverse('your-instances')
        self.assertTrue(response)
        self.assertEquals(response.status_code, 302)
        self.assertEquals(response.url, your_instances_url)
示例#5
0
    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'),
    url(r'^messages/(?P<pk>[-\d]+)/answers/create/$', AnswerCreateView.as_view(), name='create_answer'),
    url(r'^messages/(?P<message_pk>[-\d]+)/answers/(?P<pk>[-\d]+)/update/$', AnswerUpdateView.as_view(), name='update_answer'),
    url(r'^messages/(?P<pk>[-\d]+)/accept/$', AcceptMessageView.as_view(), name='accept_message'),
    url(r'^messages/(?P<pk>[-\d]+)/reject/$', RejectMessageView.as_view(), name='reject_message'),
    url(r'^stats/$', StatsView.as_view(), name='stats'),
    url(r'^pulling_status/$', WriteItInstanceStatusView.as_view(), name='pulling_status'),
    url(r'^delete/$',
        WriteItDeleteView.as_view(template_name="nuntium/profiles/writeitinstance_check_delete.html"),
        name='delete_an_instance'),
    url(r'^messages/(?P<pk>[-\d]+)/toggle-public/$', MessageTogglePublic.as_view(), name='toggle_public'),
    url(r'^moderation_accept/(?P<slug>[-\w]+)/?$', AcceptModerationView.as_view(), name='moderation_accept'),
    url(r'^moderation_reject/(?P<slug>[-\w]+)/?$', RejectModerationView.as_view(), name='moderation_rejected'),
    url(r'^welcome/$', WelcomeView.as_view(), name='welcome'),

)

js_info_dict = {
    'packages': ('nuntium',),
}

write_message_wizard = WriteMessageView.as_view(url_name='write_message_step')

urlpatterns = i18n_patterns('',
示例#6
0
    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'),
    url(r'^messages/(?P<pk>[-\d]+)/answers/create/$', AnswerCreateView.as_view(), name='create_answer'),
    url(r'^messages/(?P<message_pk>[-\d]+)/answers/(?P<pk>[-\d]+)/update/$', AnswerUpdateView.as_view(), name='update_answer'),
    url(r'^messages/(?P<pk>[-\d]+)/accept/$', AcceptMessageView.as_view(), name='accept_message'),
    url(r'^messages/(?P<pk>[-\d]+)/reject/$', RejectMessageView.as_view(), name='reject_message'),
    url(r'^stats/$', StatsView.as_view(), name='stats'),
    url(r'^pulling_status/$', WriteItInstanceStatusView.as_view(), name='pulling_status'),
    url(r'^delete/$',
        WriteItDeleteView.as_view(template_name="nuntium/profiles/writeitinstance_check_delete.html"),
        name='delete_an_instance'),
    url(r'^messages/(?P<pk>[-\d]+)/toggle-public/$', MessageTogglePublic.as_view(), name='toggle_public'),
    url(r'^moderation_accept/(?P<slug>[-\w]+)/?$', AcceptModerationView.as_view(), name='moderation_accept'),
    url(r'^moderation_reject/(?P<slug>[-\w]+)/?$', RejectModerationView.as_view(), name='moderation_rejected'),
    url(r'^welcome/$', WelcomeView.as_view(), name='welcome'),

)

js_info_dict = {
    'packages': ('nuntium',),
}

write_message_wizard = WriteMessageView.as_view(url_name='write_message_step')

urlpatterns = i18n_patterns('',