Example #1
0
def test_clean_html_non_string():
    # allow a datetime for compatibility with older ckanext-datapusher
    assert (h.clean_html(datetime.datetime(
        2018, 1, 5, 10, 48, 23, 463511)) == u"2018-01-05 10:48:23.463511")
Example #2
0
def test_clean_html_disallowed_tag():
    assert h.clean_html("<b><bad-tag>Hello") == u"<b>&lt;bad-tag&gt;Hello</b>"
Example #3
0
 def test_non_string(self):
     # allow a datetime for compatibility with older ckanext-datapusher
     eq_(h.clean_html(datetime.datetime(2018, 1, 5, 10, 48, 23, 463511)),
         u'2018-01-05 10:48:23.463511')
Example #4
0
 def test_disallowed_tag(self):
     eq_(h.clean_html('<b><bad-tag>Hello'),
         u'<b>&lt;bad-tag&gt;Hello&lt;/bad-tag&gt;</b>')
Example #5
0
 def test_non_string(self):
     # allow a datetime for compatibility with older ckanext-datapusher
     eq_(h.clean_html(datetime.datetime(2018, 1, 5, 10, 48, 23, 463511)),
         u'2018-01-05 10:48:23.463511')
Example #6
0
 def test_disallowed_tag(self):
     eq_(h.clean_html('<b><bad-tag>Hello'),
         u'<b>&lt;bad-tag&gt;Hello&lt;/bad-tag&gt;</b>')