示例#1
0
    def test_should_return_error_message_as_is_for_unsuccessful_contact_registration(self):
        project_id = None
        message = "Some error message"
        reporter_id = None
        actual_text = RegisterDatasenderView()._get_message_text(message, project_id, reporter_id)

        self.assertEqual(actual_text, "Some error message")
示例#2
0
    def test_should_return_original_message_when_project_id_is_present_for_unsuccessful_data_sender_registration(self):
        project_id = '12345'
        message = "Original message"
        reporter_id = None
        actual_text = RegisterDatasenderView()._get_message_text(message, project_id, reporter_id)

        self.assertEqual(actual_text, message)
示例#3
0
    def test_should_return_success_message_for_successful_contact_registration(self):
        project_id = None
        message = "Some success message"
        reporter_id = "short_code"
        actual_text = RegisterDatasenderView()._get_message_text(message, project_id, reporter_id)

        self.assertEqual(actual_text, "Your Contact has been successfully added. ID is: short_code")
示例#4
0
from django.conf.urls.defaults import patterns, url
from datawinners.entity.view.all_datasenders import AllDataSendersView, AllDataSendersAjaxView, AssociateDataSendersView, DisassociateDataSendersView, delete_data_senders, UsersInSearchedDataSender
from datawinners.entity.view.datasenders import EditDataSenderView
from datawinners.entity.view.datasenders import DataSenderRegistrationFormView, RegisterDatasenderView
from datawinners.entity.view.datasenders_autocomplete import AllDataSenderAutoCompleteView
from datawinners.entity.view.import_template import import_template
from datawinners.entity.views import create_multiple_web_users, edit_subject_questionnaire, save_questionnaire, edit_subject
from datawinners.entity.views import create_subject, subject_autocomplete
from datawinners.entity.views import create_type
from datawinners.entity.views import all_subject_types, delete_subjects, all_subjects, all_subjects_ajax
from datawinners.entity.views import import_subjects_from_project_wizard
from datawinners.entity.views import export_subject

urlpatterns = patterns('',
                       url(r'datasender/create', DataSenderRegistrationFormView.as_view(), name="create_data_sender"),
                       url(r'datasender/register',RegisterDatasenderView.as_view(),name="register_data_sender"),
                       (r'datasender/edit/(?P<reporter_id>.+?)/$', EditDataSenderView.as_view()),
                       (r'webuser/create', create_multiple_web_users),
                       url(r'subject/create/(?P<entity_type>.+?)/$', create_subject, name='create_subject'),
                       url(r'subject/edit/(?P<entity_type>.+?)/(?P<entity_id>.+?)/$', edit_subject,
                           name="edit_subject"),
                       (r'type/create', create_type),
                       (r'subjects/delete/$', delete_subjects),
                       (r'subjects/(?P<subject_type>.+?)/ajax/$', all_subjects_ajax),
                       url(r'subjects/(?P<subject_type>.+?)/$', all_subjects, name="all_subjects"),
                       (r'delete/$', delete_data_senders),
                       url(r'datasenders/$', AllDataSendersView.as_view(), name='all_datasenders'),
                       url(r'datasenders/ajax/$', AllDataSendersAjaxView.as_view(), name="all_datasenders_ajax"),
                       url(r'datasenders/autocomplete/$', AllDataSenderAutoCompleteView.as_view()),
                       url(r'(?P<entity_type>.+?)/autocomplete/$', subject_autocomplete),
                       (r'disassociate/$', DisassociateDataSendersView.as_view()),
示例#5
0
from datawinners.entity.view.questionnaires import get_existing_questionnaires, get_questionnaires_and_polls
from datawinners.entity.view.send_sms import SendSMS, get_all_mobile_numbers
from datawinners.entity.view.unique_id import delete_subjects
from datawinners.entity.views import all_subject_types, all_subjects, all_subjects_ajax, map_data, map_data_for_reports
from datawinners.entity.views import create_multiple_web_users, edit_subject_questionnaire, save_questionnaire, edit_subject, get_questionnaire_details_ajax, create_group, \
    share_token, save_preference, map_admin
from datawinners.entity.views import create_subject, subject_autocomplete
from datawinners.entity.views import create_type
from datawinners.entity.views import delete_subject_types
from datawinners.entity.views import export_subject
from datawinners.entity.views import import_subjects_from_project_wizard

urlpatterns = patterns(
    '',
    url(r'datasender/register',
        RegisterDatasenderView.as_view(),
        name="register_data_sender"),
    (r'datasender/edit/(?P<reporter_id>.+?)/$', EditDataSenderView.as_view()),
    (r'webuser/create', create_multiple_web_users),
    url(r'subject/create/(?P<entity_type>.+?)/$',
        create_subject,
        name='create_subject'),
    url(r'subject/map/(?P<entity_type>.+?)/$', map_admin, name='map_admin'),
    url(r'subject/edit/(?P<entity_type>.+?)/(?P<entity_id>.+?)/$',
        edit_subject,
        name="edit_subject"), (r'(?P<entity_type>.+?)/map$', map_data),
    (r'(?P<entity_type>.+?)/map/(?P<report_id>.+?)$', map_data_for_reports),
    (r'(?P<entity_type>.+?)/sharetoken$', share_token),
    (r'(?P<entity_type>.+?)/save_preference$', save_preference),
    (r'type/create', create_type), (r'group/create', create_group),
    (r'subjects/delete/$', delete_subjects),