test_markdown: Use assertTrue/assertFalse instead of assertEqual.

This commit is contained in:
akshatdalton 2021-05-31 18:48:48 +00:00 committed by Tim Abbott
parent 68111d967a
commit 6143cb6e73
1 changed files with 13 additions and 13 deletions

View File

@ -711,7 +711,7 @@ class MarkdownTest(ZulipTestCase):
@override_settings(INLINE_IMAGE_PREVIEW=False)
def test_image_preview_enabled(self) -> None:
ret = image_preview_enabled()
self.assertEqual(ret, False)
self.assertFalse(ret)
settings.INLINE_IMAGE_PREVIEW = True
@ -720,22 +720,22 @@ class MarkdownTest(ZulipTestCase):
realm = message.get_realm()
ret = image_preview_enabled()
self.assertEqual(ret, True)
self.assertTrue(ret)
ret = image_preview_enabled(no_previews=True)
self.assertEqual(ret, False)
self.assertFalse(ret)
ret = image_preview_enabled(message, realm)
self.assertEqual(ret, True)
self.assertTrue(ret)
ret = image_preview_enabled(message)
self.assertEqual(ret, True)
self.assertTrue(ret)
ret = image_preview_enabled(message, realm, no_previews=True)
self.assertEqual(ret, False)
self.assertFalse(ret)
ret = image_preview_enabled(message, no_previews=True)
self.assertEqual(ret, False)
self.assertFalse(ret)
@override_settings(INLINE_URL_EMBED_PREVIEW=False)
def test_url_embed_preview_enabled(self) -> None:
@ -748,23 +748,23 @@ class MarkdownTest(ZulipTestCase):
realm.save(update_fields=["inline_url_embed_preview"])
ret = url_embed_preview_enabled()
self.assertEqual(ret, False)
self.assertFalse(ret)
settings.INLINE_URL_EMBED_PREVIEW = True
ret = url_embed_preview_enabled()
self.assertEqual(ret, True)
self.assertTrue(ret)
ret = image_preview_enabled(no_previews=True)
self.assertEqual(ret, False)
self.assertFalse(ret)
ret = url_embed_preview_enabled(message, realm)
self.assertEqual(ret, True)
self.assertTrue(ret)
ret = url_embed_preview_enabled(message)
self.assertEqual(ret, True)
self.assertTrue(ret)
ret = url_embed_preview_enabled(message, no_previews=True)
self.assertEqual(ret, False)
self.assertFalse(ret)
def test_inline_dropbox(self) -> None:
msg = "Look at how hilarious our old office was: https://www.dropbox.com/s/ymdijjcg67hv2ta/IMG_0923.JPG"