def test_complex_tags_in_attribute(self): tagged_value = """<p style="display:none;" id="test">This is not a templated text<p> <div class="test_css">Something in ícontainer</div> <p>£682m</p>""" attribute_target_value = """This is not a templated text Something in ícontainer £682m""" r = ResourceBase() filtered_value = r._remove_html_tags(tagged_value) self.assertEqual(filtered_value, attribute_target_value)
def test_converted_html_in_tags_with_with_multiple_tags(self): tagged_value = """<p><p><p><p>Abstract value & some text</p></p></p></p>""" attribute_target_value = """Abstract value & some text""" r = ResourceBase() filtered_value = r._remove_html_tags(tagged_value) self.assertEqual(filtered_value, attribute_target_value)
def test_converted_html_in_tags_with_char_references(self): tagged_value = """<p><p>Abstract value & some text</p></p>""" attribute_target_value = """Abstract value & some text""" r = ResourceBase() filtered_value = r._remove_html_tags(tagged_value) self.assertEqual(filtered_value, attribute_target_value)
def test_simple_tags_in_attribute(self): tagged_value = "<p>This is not a templated text<p>" attribute_target_value = "This is not a templated text" r = ResourceBase() filtered_value = r._remove_html_tags(tagged_value) self.assertEqual(filtered_value, attribute_target_value)
def test_not_tags_in_attribute(self): attribute_target_value = "This is not a templated text" r = ResourceBase() filtered_value = r._remove_html_tags(attribute_target_value) self.assertEqual(attribute_target_value, filtered_value)