Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
tests: INLINE_IMAGE_PREVIEW=True is already the default.
Alex Vandiver060754980cef
diff --git a/zerver/tests/test_markdown.py b/zerver/tests/test_markdown.pyindex 9351711effe..391488e6034 100644--- a/zerver/tests/test_markdown.py+++ b/zerver/tests/test_markdown.py@@ -664,7 +664,7 @@ class MarkdownTest(ZulipTestCase):'<p><a href="https://vimeo.com/246979354">https://vimeo.com/246979354</a></p>',)- @override_settings(THUMBNAIL_IMAGES=True, INLINE_IMAGE_PREVIEW=True)+ @override_settings(THUMBNAIL_IMAGES=True)def test_inline_image_thumbnail_url(self) -> None:realm = get_realm("zephyr")msg = "[foobar](/user_uploads/{realm_id}/50/w2G6ok9kr8AMCQCTNAUOFMln/IMG_0677.JPG)"@@ -704,7 +704,7 @@ class MarkdownTest(ZulipTestCase):converted = markdown_convert_wrapper(msg)self.assertIn(thumbnail_img, converted)- @override_settings(THUMBNAIL_IMAGES=True, INLINE_IMAGE_PREVIEW=True)+ @override_settings(THUMBNAIL_IMAGES=True)def test_inline_image_preview(self) -> None:with_preview = '<div class="message_inline_image"><a href="http://cdn.wallpapersafari.com/13/6/16eVjx.jpeg"><img data-src-fullsize="/thumbnail?url=http%3A%2F%2Fcdn.wallpapersafari.com%2F13%2F6%2F16eVjx.jpeg&size=full" src="/thumbnail?url=http%3A%2F%2Fcdn.wallpapersafari.com%2F13%2F6%2F16eVjx.jpeg&size=thumbnail"></a></div>'without_preview = '<p><a href="http://cdn.wallpapersafari.com/13/6/16eVjx.jpeg">http://cdn.wallpapersafari.com/13/6/16eVjx.jpeg</a></p>'@@ -762,7 +762,6 @@ class MarkdownTest(ZulipTestCase):converted = markdown_convert_wrapper(content)self.assertIn(converted, thumbnail_img)- @override_settings(INLINE_IMAGE_PREVIEW=True)def test_max_inline_preview(self) -> None:image_links = [# Add a youtube link within a spoiler to ensure other link types are counted@@ -795,7 +794,7 @@ class MarkdownTest(ZulipTestCase):soup = BeautifulSoup(converted, "html.parser")self.assert_length(soup(class_="message_inline_image"), 0)- @override_settings(THUMBNAIL_IMAGES=True, INLINE_IMAGE_PREVIEW=True)+ @override_settings(THUMBNAIL_IMAGES=True)def test_inline_image_quoted_blocks(self) -> None:content = "http://cdn.wallpapersafari.com/13/6/16eVjx.jpeg"expected = '<div class="message_inline_image"><a href="http://cdn.wallpapersafari.com/13/6/16eVjx.jpeg"><img data-src-fullsize="/thumbnail?url=http%3A%2F%2Fcdn.wallpapersafari.com%2F13%2F6%2F16eVjx.jpeg&size=full" src="/thumbnail?url=http%3A%2F%2Fcdn.wallpapersafari.com%2F13%2F6%2F16eVjx.jpeg&size=thumbnail"></a></div>'@@ -830,7 +829,7 @@ class MarkdownTest(ZulipTestCase):converted = render_message_markdown(msg, content)self.assertEqual(converted.rendered_content, expected)- @override_settings(THUMBNAIL_IMAGES=True, INLINE_IMAGE_PREVIEW=True)+ @override_settings(THUMBNAIL_IMAGES=True)def test_inline_image_preview_order(self) -> None:realm = get_realm("zulip")content = "http://imaging.nikon.com/lineup/dslr/df/img/sample/img_01.jpg\nhttp://imaging.nikon.com/lineup/dslr/df/img/sample/img_02.jpg\nhttp://imaging.nikon.com/lineup/dslr/df/img/sample/img_03.jpg"@@ -870,7 +869,7 @@ class MarkdownTest(ZulipTestCase):converted = render_message_markdown(msg, content)self.assertEqual(converted.rendered_content, expected)- @override_settings(THUMBNAIL_IMAGES=True, INLINE_IMAGE_PREVIEW=True)+ @override_settings(THUMBNAIL_IMAGES=True)def test_corrected_image_source(self) -> None:# testing only Wikipedia because linx.li URLs can be expected to expirecontent = "https://en.wikipedia.org/wiki/File:Wright_of_Derby,_The_Orrery.jpg"