'Verify that <p> question text before responsetype not deleted when
it contains other children and label is picked from label attribute of inputtype
This is the case when author updated the <p> immediately before
responsetype to contain other elements. We do not want to delete information in that case.'

def test_question_title_not_removed_got_children(self):

    question = 'Is    egg    plant    a    fruit?'
    xml = '\n                                <problem>\n                                                <p>Choose    wisely.</p>\n                                                <p>Select    the    correct    synonym    of    paranoid?</p>\n                                                <p><img    src=""    /></p>\n                                                <choiceresponse>\n                                                                <checkboxgroup    label="{}">\n                                                                                <choice    correct="true">over-suspicious</choice>\n                                                                                <choice    correct="false">funny</choice>\n                                                                </checkboxgroup>\n                                                </choiceresponse>\n                                </problem>\n                                '.format(question)
    problem = new_loncapa_problem(xml)
    self.assertEqual(problem.problem_data, {'1_2_1': {'label': '', 'descriptions': {}}})
    self.assertEqual(len(problem.tree.xpath('//p/img')), 1)
