def test_video_upload_to_floip(): """ Test XForm video question to FLOIP. """ survey = Survey(name='floip') element = xform_from_floip_dict(survey, 'ae54d8', { "type": "video", "label": "Upload a video recording", "type_options": {} }) question = floip_dict_from_xform_dict(element.to_json_dict()) assert question == { "type": "video", "label": "Upload a video recording", "type_options": {} }
def test_time_question_to_floip(): """ Test XForm time question to FLOIP """ survey = Survey(name='floip') element = xform_from_floip_dict(survey, 'ae54d8', { "type": "time", "label": "What is the time?", "type_options": {} }) question = floip_dict_from_xform_dict(element.to_json_dict()) assert question == { "type": "time", "label": "What is the time?", "type_options": {} }
def test_geopoint_question_to_floip(): """ Test geopoint question to FLOIP geo_point dictionary. """ survey = Survey(name='floip') element = xform_from_floip_dict(survey, 'ae54db', { "type": "geo_point", "label": "Where are you?", "type_options": {} }) question = floip_dict_from_xform_dict(element.to_json_dict()) assert question == { "type": "geo_point", "label": "Where are you?", "type_options": {} }
def test_numeric_question_to_floip(): """ Test numeric floip queston to XForm. """ survey = Survey(name='floip') element = xform_from_floip_dict( survey, 'ae54d8', { "type": "numeric", "label": "How much do you weigh, in lbs?", "type_options": {} }) question = floip_dict_from_xform_dict(element.to_json_dict()) assert question == { "type": "numeric", "label": "How much do you weigh, in lbs?", "type_options": {} }
def test_image_upload_to_floip(): """ Test an XForm image question to FLOIP. """ survey = Survey(name='floip') element = xform_from_floip_dict( survey, 'ae54d8', { "type": "image", "label": "Upload an image of your location", "type_options": {} }) question = floip_dict_from_xform_dict(element.to_json_dict()) assert question == { "type": "image", "label": "Upload an image of your location", "type_options": {} }
def test_select_many_q_to_floip(): """ Test XForm select_many question to FLOIP. """ survey = Survey(name='floip') element = xform_from_floip_dict( survey, 'ae54d8', { "type": "select_many", "label": "What is your favorite desert?", "type_options": { "choices": ["cake", "fruit", "ice cream"] } }) question = floip_dict_from_xform_dict(element.to_json_dict()) assert question == { "type": "select_many", "label": "What is your favorite desert?", "type_options": { "choices": ["cake", "fruit", "ice cream"] } }
def test_select_one_q_to_floip(): """ Test XForm select_one question to FLOIP. """ survey = Survey(name='floip') element = xform_from_floip_dict( survey, 'ae54d8', { "type": "select_one", "label": "Are you male or female?", "type_options": { "choices": ["male", "female", "not identified"] } }) question = floip_dict_from_xform_dict(element.to_json_dict()) assert question == { "type": "select_one", "label": "Are you male or female?", "type_options": { "choices": ["male", "female", "not identified"] } }
def test_numeric_range_q_to_floip(): """ Test XForm numeric range queston to FLOIP. """ survey = Survey(name='floip') element = xform_from_floip_dict( survey, 'ae54d8', { "type": "numeric", "label": "How much do you weigh, in lbs?", "type_options": { "range": [1, 250] } }) question = floip_dict_from_xform_dict(element.to_json_dict()) assert question == { "type": "numeric", "label": "How much do you weigh, in lbs?", "type_options": { "range": [1, 250] } }