def test_returns_embedded_video(self): content = _fetch_mdn_page(test_items[0]['url']) assert('<a href="http://www.youtube.com/1234" ' 'class="video-embed">Some Youtube link</a>' not in content) assert('<iframe frameborder="0" width="640" height="360" ' 'src="http://www.youtube.com/1234"' in content)
def test_ensure_relative_image_is_absolute(self): content = _fetch_mdn_page(test_items[0]['url']) assert '<img src="/relative/url">' not in content assert('<img src="https://developer.mozilla.org/relative/url' in content)
def test_get_page_content(self): content = _fetch_mdn_page(test_items[0]['url']) eq_(469, len(content))
def test_ensure_content_xss_safe(self): content = _fetch_mdn_page(test_items[0]['url']) assert '<script>' not in content assert '<script>alert' in content assert '<b>hi</b>' in content
def test_ensure_toc_xss_safe(self): content = _fetch_mdn_page(test_items[0]['url']) assert '<script>' not in content[0] assert '<script>alert' in content[0] assert '<li>' in content[0]
def test_get_page_content(self): content = _fetch_mdn_page(test_items[0]['url']) eq_(2, len(content))
def test_ensure_relative_image_is_absolute(self): content = _fetch_mdn_page(test_items[0]['url']) assert '<img src="/relative/url">' not in content assert ('<img src="https://developer.mozilla.org/relative/url' in content)