[issue2551335] FAILED test/test_templating.py::Markdown2TestCase::test_markdown_hyperlinked_url - AssertionError

Viorel <[email protected]> Sat, 20 Apr 2024 11:48:00 +0000
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
New submission from Viorel:

Thank you for fixing issue #2551272

There are 2 more tests that fail in test_templating.py::Markdown2TestCase, tested with python 3.11 and python 3.12.

_______________________________________ Markdown2TestCase.test_markdown_hyperlinked_url _______________________________________

self = <test.test_templating.Markdown2TestCase testMethod=test_markdown_hyperlinked_url>

    def test_markdown_hyperlinked_url(self):
        # classic markdown does not emit a \n at end of rendered string
        # so rstrip \n.
        p = StringHTMLProperty(self.client, 'test', '1', None, 'test', u2s(u'http://example.com/'))
        m = p.markdown(hyperlink=1)
        m = self.mangleMarkdown2(m)
        print(m)
        self.assertEqual(m.rstrip('\n'), '<p><a href="http://example.com/" rel="nofollow noopener">http://example.com/</a></p>')
    
        p = StringHTMLProperty(self.client, 'test', '1', None, 'test', u2s(u'<http://example.com/>'))
        m = p.markdown(hyperlink=1)
        m = self.mangleMarkdown2(m)
        self.assertEqual(m.rstrip('\n'), '<p><a href="http://example.com/" rel="nofollow noopener">http://example.com/</a></p>')
    
        p = StringHTMLProperty(self.client, 'test', '1', None, 'test', u2s(u'[label](http://example.com/ "a title")'))
        m = p.markdown(hyperlink=1)
        m = self.mangleMarkdown2(m)
>       self.assertEqual(m.rstrip('\n'), '<p><a href="http://example.com/" rel="nofollow noopener" title="a title">label</a></p>')
E       AssertionError: '<p><a href="#" title="a title">label</a></p>' != '<p><a href="http://example.com/" rel="nofollow noopen[29 chars]</p>'
E       - <p><a href="#" title="a title">label</a></p>
E       + <p><a href="http://example.com/" rel="nofollow noopener" title="a title">label</a></p>

m          = '<p><a href="#" title="a title">label</a></p>\n'
p          = <StringHTMLProperty(0x7f51dac3b450) test1@test None '[label](http://example.com/ "a title")'>
self       = <test.test_templating.Markdown2TestCase testMethod=test_markdown_hyperlinked_url>

test/test_templating.py:908: AssertionError
---------------------------------------------------- Captured stdout call -----------------------------------------------------
<p><a href="http://example.com/" rel="nofollow noopener">http://example.com/</a></p>

----------
components: Test
messages: 7989
nosy: ceamac
severity: normal
status: new
title: FAILED test/test_templating.py::Markdown2TestCase::test_markdown_hyperlinked_url - AssertionError
type: compile error
versions: 2.3.0

_________________________________________________
Roundup tracker <[email protected]>
<https://issues.roundup-tracker.org/issue2551335>
_________________________________________________