def test_questions_by_department():
    """questions_by_department works as expected
    """
    departments = niaopendata.department_list_current()
    rand_smpl = [departments[i] for i in sorted(random.sample(range(len(departments)), 3))]
    for department in rand_smpl:
        r = niaopendata.questions_by_department(department['OrganisationId'])
        _check_valid_list_response(r)
def test_question_details():
    """question_details works as expected
    """
    department = niaopendata.department_list_current()[0]
    questions = niaopendata.questions_by_department(department['OrganisationId'])
    rand_smpl = [questions[i] for i in sorted(random.sample(range(len(questions)), 3))]
    for question in rand_smpl:
        r = niaopendata.question_details(question['DocumentId'])
        _check_valid_list_response(r)