Opened 8 years ago

Closed 6 years ago

#10843 closed Bug (fixed)

django.contrib.markup.tests.Templates test_textile fails with python textile 2.1.3 and Django 1.0.2 final

Reported by: ntoll Owned by: nobody
Component: Testing framework Version:
Severity: Normal Keywords: Textile
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX:

Description (last modified by Alex Gaynor)

Getting the following message:

======================================================================
FAIL: test_textile (django.contrib.markup.tests.Templates)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Library/Python/2.5/site-packages/django/contrib/markup/tests.py", line 27, in test_textile
    <p>Paragraph 2 with &#8220;quotes&#8221; and <code>code</code></p>""")
AssertionError: u'<p>Paragraph 1</p>\n\n\t<p>Paragraph 2 with &#8220;quotes&#8221; and <code>code</code></p>' != '<p>Paragraph 1</p>\n\n<p>Paragraph 2 with &#8220;quotes&#8221; and <code>code</code></p>'

----------------------------------------------------------------------

Looks like there is an extra "\t" in there before the "Paragraph 2" <p> element.

Attachments (3)

ticket10843.patch (552 bytes) - added by Arthur Koziel 8 years ago.
ticket10843.diff (1.0 KB) - added by Arthur Koziel 8 years ago.
10843.patch (589 bytes) - added by Bruno Renié 7 years ago.
Patch without version check, just removes tabs from the rendered text

Download all attachments as: .zip

Change History (14)

comment:1 Changed 8 years ago by Alex Gaynor

Description: modified (diff)

Please use preview.

Changed 8 years ago by Arthur Koziel

Attachment: ticket10843.patch added

comment:2 Changed 8 years ago by Arthur Koziel

Has patch: set

I can confirm that. There needs to be an extra '\t'.

comment:3 Changed 8 years ago by Karen Tracey

Patch needs improvement: set

Just adding a '\t' will cause the test to fail on older versions of textile (the test currently works for me, for example, with textile 2.0.10 which is what is installed on my ubuntu machine, but would break if the test was expecting the extra '\t'). We don't want to just move the problem, we want to fix it.

Changed 8 years ago by Arthur Koziel

Attachment: ticket10843.diff added

comment:4 Changed 8 years ago by Arthur Koziel

Patch needs improvement: unset

I've only tried versions from 2.1.0 to 2.1.3. The 2.0.x versions don't have the '\t'.

comment:5 Changed 7 years ago by Alex Gaynor

Triage Stage: UnreviewedAccepted

comment:6 Changed 7 years ago by Bruno Renié

Wouldn't it be safe just to change

self.assertEqual(rendered, """<p>Paragraph 1</p> # etc

to

self.assertEqual(rendered.replace('\t', ''), """<p>Paragraph 1</p> # etc

We don't really care about tabulations (only the markup is important), and it
prevents the test to fail if textile changes its behavior again in the future.

Changed 7 years ago by Bruno Renié

Attachment: 10843.patch added

Patch without version check, just removes tabs from the rendered text

comment:7 Changed 6 years ago by Jacob

Resolution: fixed
Status: newclosed

(In [13360]) Fixed #10843: the textile tests now pass against the latest textile library.

comment:8 Changed 6 years ago by themystic

Resolution: fixed
Status: closedreopened

Occurred again with django 1.2.1 and textile 2.1.4.

$python manage.py test

yields:

======================================================================
FAIL: test_textile (django.contrib.markup.tests.Templates)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/Django-1.2.1-py2.6.egg/django/contrib/markup/tests.py", line 27, in test_textile
    <p>Paragraph 2 with &#8220;quotes&#8221; and <code>code</code></p>""")
AssertionError: u'<p>Paragraph 1</p>\n\n\t<p>Paragraph 2 with &#8220;quotes&#8221; and <code>code</code></p>' != '<p>Paragraph 1\
</p>\n\n<p>Paragraph 2 with &#8220;quotes&#8221; and <code>code</code></p>'

----------------------------------------------------------------------

Removing the textile egg resolves the issue (since I don't need textile for anything).

comment:9 Changed 6 years ago by Chris Beaven

Severity: Release blocker
Type: Bug

Increasing severity, working tests are paramount.

comment:10 Changed 6 years ago by patchhammer

Easy pickings: unset
Patch needs improvement: set

10843.patch fails to apply cleanly on to trunk

comment:11 Changed 6 years ago by Luke Plant

Resolution: fixed
Severity: Release blockerNormal
Status: reopenedclosed

1.2.1 was released *before* the fix for this, and in 1.2.2 and on 1.3.X and trunk, the test passes (with textile==2.1.4). I have no idea why the bug has been reopened.

Note: See TracTickets for help on using tickets.
Back to Top