def test_get_questions_unpacks_multiquestions():

    section = ContentSection.create(section=get_section(
        questions=['checkboxes', 'boolean'],
        multiquestions=['checkboxes', 'boolean']
    ))
    assert section.id == 'options'

    # should be a flat list with 4 entries
    questions = get_questions(section.questions)
    assert len(questions) == 4
def test_get_questions_sets_multiquestion_names_and_hints():

    section = ContentSection.create(section=get_section(
        multiquestions=['checkboxes', 'boolean']
    ))
    assert section.id == 'options'

    # hint and name of multiquestion should be preserved in nested_questions
    for question in get_questions(section.questions):
        if question.get('id').startswith('multiquestion_'):
            assert question.get('multiquestion_name') == 'Options'
            assert question.get('multiquestion_hint') == 'Please indicate your preferred options'