def test_get_xform_ids__sanity_check(self): # This helper has to mock a request in a brittle way. # If permissions are wrong, instead of returning a list, # it will return an HttpResponse containing the permission error. # This can break when permissions change. # So, just test that we aren't hitting that situation and that the response is a list. request = HttpRequest() request.POST = QueryDict('select_all=') request.couch_user = self.web_user SessionMiddleware(self.fail).process_request(request) view = XFormManagementView() view.args = (self.domain.name,) view.request = request assert isinstance(view.get_xform_ids(request), list)
XFormManagementView, XFormManagementStatusView, AutomaticUpdateRuleListView, AddAutomaticUpdateRuleView, EditAutomaticUpdateRuleView, xform_management_job_poll, default, ) from .interfaces import FormManagementMode edit_data_urls = [ url(r'^archive_forms/$', ArchiveFormView.as_view(), name=ArchiveFormView.urlname), url(r'^xform_management/$', XFormManagementView.as_view(), name=XFormManagementView.urlname), url(r'^xform_management/status/(?P<mode>{archive}|{restore})/(?P<download_id>{id_regex})/$' .format( archive=FormManagementMode.ARCHIVE_MODE, restore=FormManagementMode.RESTORE_MODE, id_regex="[0-9a-fA-Z]{25,32}", ), XFormManagementStatusView.as_view(), name=XFormManagementStatusView.urlname), url(r'^xform_management/status/poll/(?P<download_id>[0-9a-fA-Z]{25,32})/$', xform_management_job_poll, name='xform_management_job_poll'), url(r'^case_groups/$', CaseGroupListView.as_view(), name=CaseGroupListView.urlname),
CaseGroupCaseManagementView, ArchiveFormView, XFormManagementView, XFormManagementStatusView, AutomaticUpdateRuleListView, AddAutomaticUpdateRuleView, EditAutomaticUpdateRuleView, xform_management_job_poll, default, ) from .interfaces import FormManagementMode edit_data_urls = [ url(r'^archive_forms/$', ArchiveFormView.as_view(), name=ArchiveFormView.urlname), url(r'^xform_management/$', XFormManagementView.as_view(), name=XFormManagementView.urlname), url( r'^xform_management/status/(?P<mode>{archive}|{restore})/(?P<download_id>{id_regex})/$'.format( archive=FormManagementMode.ARCHIVE_MODE, restore=FormManagementMode.RESTORE_MODE, id_regex="[0-9a-fA-Z]{25,32}", ), XFormManagementStatusView.as_view(), name=XFormManagementStatusView.urlname ), url(r'^xform_management/status/poll/(?P<download_id>[0-9a-fA-Z]{25,32})/$', xform_management_job_poll, name='xform_management_job_poll'), url(r'^case_groups/$', CaseGroupListView.as_view(), name=CaseGroupListView.urlname), url(r'^case_groups/(?P<group_id>[\w-]+)/$', CaseGroupCaseManagementView.as_view(), name=CaseGroupCaseManagementView.urlname), url(r'^automatic_updates/$', AutomaticUpdateRuleListView.as_view(),
ArchiveFormView, XFormManagementView, XFormManagementStatusView, AutomaticUpdateRuleListView, EditAutomaticUpdateRuleView, xform_management_job_poll, default, AddCaseRuleView, EditCaseRuleView, ) from .interfaces import FormManagementMode edit_data_urls = [ url(r'^archive_forms/$', ArchiveFormView.as_view(), name=ArchiveFormView.urlname), url(r'^xform_management/$', XFormManagementView.as_view(), name=XFormManagementView.urlname), url( r'^xform_management/status/(?P<mode>{archive}|{restore})/(?P<download_id>{id_regex})/$'.format( archive=FormManagementMode.ARCHIVE_MODE, restore=FormManagementMode.RESTORE_MODE, id_regex="[0-9a-fA-Z]{25,32}", ), XFormManagementStatusView.as_view(), name=XFormManagementStatusView.urlname ), url(r'^xform_management/status/poll/(?P<download_id>[0-9a-fA-Z]{25,32})/$', xform_management_job_poll, name='xform_management_job_poll'), url(r'^case_groups/$', CaseGroupListView.as_view(), name=CaseGroupListView.urlname), url(r'^case_groups/(?P<group_id>[\w-]+)/$', CaseGroupCaseManagementView.as_view(), name=CaseGroupCaseManagementView.urlname), url(r'^automatic_updates/$', AutomaticUpdateRuleListView.as_view(),