Log In
Log In
Places
All Projects
Status Monitor
Collapse sidebar
waliki
python-django-waliki
python-django-waliki-markdown-tests.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File python-django-waliki-markdown-tests.patch of Package python-django-waliki
From ca56647b41bd3eae0cf00b1340010bbbec8e4031 Mon Sep 17 00:00:00 2001 From: Oleg Girko <ol@infoserver.lv> Date: Sat, 20 Nov 2021 21:15:34 +0000 Subject: [PATCH] Ignore newlines in markdown tests. Different versions of markdown package produce slightly different results that can have different newline placement. This change adapts tests to not fail because of these differences. Signed-off-by: Oleg Girko <ol@infoserver.lv> --- tests/test_models.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_models.py b/tests/test_models.py index 07c374d..3285853 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -29,7 +29,7 @@ I'm Markdown <script>alert()</script> """ -md_html = """<h2 id="hi">Hi</h2>\n<p>I\'m Markdown\n</p>\n""" +md_html = """<h2 id="hi">Hi</h2><p>I\'m Markdown</p>""" class TestPage(TestCase): @@ -113,10 +113,10 @@ class TestMarkdown(TestCase): def test_body(self): page = PageFactory(path='test.md', markup='Markdown', raw=md) - self.assertEqual(page.body, md_html) + self.assertEqual(page.body.replace('\n', ''), md_html) def test_preview(self): - self.assertEqual(Page.preview('Markdown', md), md_html) + self.assertEqual(Page.preview('Markdown', md).replace('\n', ''), md_html) def test_link_explicit(self): s = settings.WALIKI_MARKUPS_SETTINGS.get('Markdown') -- 2.33.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Contact
Support
@OBShq
The Open Build Service is an
openSUSE project
.
Log In
Places
Places
All Projects
Status Monitor