Esempio n. 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")
Esempio n. 2
0
def test_clean_html_disallowed_tag():
    assert h.clean_html("<b><bad-tag>Hello") == u"<b>&lt;bad-tag&gt;Hello</b>"
Esempio n. 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')
Esempio n. 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>')
Esempio n. 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')
Esempio n. 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>')