'Make sure that poll_module will export fine if its xml contains
unescaped characters.'

def test_poll_export_with_unescaped_characters_xml(self):

    module_system = DummySystem(load_error_modules=True)
    id_generator = Mock()
    id_generator.target_course_id = self.xmodule.course_id
    sample_poll_xml = '\n                                <poll_question    display_name="Poll    Question">\n                                                <p>How    old    are    you?</p>\n                                                <answer    id="less18">18</answer>\n                                </poll_question>\n                                '
    output = PollDescriptor.from_xml(sample_poll_xml, module_system, id_generator)
    invalid_characters_poll_answer = output.answers[0]
    invalid_characters_poll_answer['text'] = '<    18'
    output.answers[0] = invalid_characters_poll_answer
    output.save()
    xml = output.definition_to_xml(None)
    child_texts = xml.xpath('//text()')
    self.assertEqual(child_texts[(-1)], '<    18')
