tests: INLINE_IMAGE_PREVIEW=True is already the default.

This commit is contained in:
Alex Vandiver 2024-07-18 14:08:57 +00:00 committed by Tim Abbott
parent bfd5cdf6b9
commit 060754980c
1 changed files with 5 additions and 6 deletions

View File

@ -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&amp;size=full" src="/thumbnail?url=http%3A%2F%2Fcdn.wallpapersafari.com%2F13%2F6%2F16eVjx.jpeg&amp;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&amp;size=full" src="/thumbnail?url=http%3A%2F%2Fcdn.wallpapersafari.com%2F13%2F6%2F16eVjx.jpeg&amp;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 expire
content = "https://en.wikipedia.org/wiki/File:Wright_of_Derby,_The_Orrery.jpg"