'Verify question tag correctness.'

def assert_question_tag(self, question1, question2, tag, label_attr=False):

    question1_tag = ('<{tag}>{}</{tag}>'.format(question1, tag=tag) if question1 else '')
    question2_tag = ('<{tag}>{}</{tag}>'.format(question2, tag=tag) if question2 else '')
    question1_label_attr = ('label="{}"'.format(question1) if label_attr else '')
    question2_label_attr = ('label="{}"'.format(question2) if label_attr else '')
    xml = '\n                                <problem>\n                                                {question1_tag}\n                                                <choiceresponse>\n                                                                <checkboxgroup    {question1_label_attr}>\n                                                                                <choice    correct="true">choice1</choice>\n                                                                                <choice    correct="false">choice2</choice>\n                                                                </checkboxgroup>\n                                                </choiceresponse>\n                                                {question2_tag}\n                                                <multiplechoiceresponse>\n                                                                <choicegroup    type="MultipleChoice"    {question2_label_attr}>\n                                                                                <choice    correct="false">choice1</choice>\n                                                                                <choice    correct="true">choice2</choice>\n                                                                </choicegroup>\n                                                </multiplechoiceresponse>\n                                </problem>\n                                '.format(question1_tag=question1_tag, question2_tag=question2_tag, question1_label_attr=question1_label_attr, question2_label_attr=question2_label_attr)
    problem = new_loncapa_problem(xml)
    self.assertEqual(problem.problem_data, {'1_2_1': {'label': question1, 'descriptions': {}}, '1_3_1': {'label': question2, 'descriptions': {}}})
    self.assertEqual(len(problem.tree.xpath('//{}'.format(tag))), 0)
