From c716ab626781a9861832ff4b56492746597313bf Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 05 2019 15:53:49 +0000 Subject: Adjust the unit-tests for old markdown Looks like the html generated between old markdown library and newer one changed, so this commit adjusts our tests so they pass on the old markdown version. Signed-off-by: Pierre-Yves Chibon --- diff --git a/tests/test_pagure_lib.py b/tests/test_pagure_lib.py index cbb81ad..2d6d535 100644 --- a/tests/test_pagure_lib.py +++ b/tests/test_pagure_lib.py @@ -4118,6 +4118,11 @@ class PagureLibtests(tests.Modeltests): pass bleach_v[idx] = val + # old markdown generate other html + import markdown + markdown_v = markdown.__version__.version_info + old_markdown = markdown_v < (2, 6, 0) + texts = [ 'foo bar test#1 see?', 'foo bar pingou/test#2 I mean, really', @@ -4245,18 +4250,35 @@ class PagureLibtests(tests.Modeltests): '

@pingou at start of line

', # 'but not someone@pingou.com', '

but not someone@pingou.com

', - # '[![Fedora_infinity_small.png]' - # '(/test/issue/raw/Fedora_infinity_small.png)]' - # '(/test/issue/raw/Fedora_infinity_small.png)', - '

' - 'Fedora_infinity_small.png' - '

', ] + if old_markdown: + expected.append( + # '[![Fedora_infinity_small.png]' + # '(/test/issue/raw/Fedora_infinity_small.png)]' + # '(/test/issue/raw/Fedora_infinity_small.png)', + '

' + 'Fedora_infinity_small.png' + '

' + ) + else: + expected.append( + # '[![Fedora_infinity_small.png]' + # '(/test/issue/raw/Fedora_infinity_small.png)]' + # '(/test/issue/raw/Fedora_infinity_small.png)', + '

' + 'Fedora_infinity_small.png' + '

' + ) + with self.app.application.app_context(): g.session = self.session for idx, text in enumerate(texts):