Opened 15 years ago

Closed 13 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: no

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 15 years ago.
ticket10843.diff (1.0 KB ) - added by Arthur Koziel 15 years ago.
10843.patch (589 bytes ) - added by Bruno Renié 14 years ago.
Patch without version check, just removes tabs from the rendered text

Download all attachments as: .zip

Change History (14)

comment:1 by Alex Gaynor, 15 years ago

Description: modified (diff)

Please use preview.

by Arthur Koziel, 15 years ago

Attachment: ticket10843.patch added

comment:2 by Arthur Koziel, 15 years ago

Has patch: set

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

comment:3 by Karen Tracey, 15 years ago

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.

by Arthur Koziel, 15 years ago

Attachment: ticket10843.diff added

comment:4 by Arthur Koziel, 15 years ago

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 by Alex Gaynor, 15 years ago

Triage Stage: UnreviewedAccepted

comment:6 by Bruno Renié, 14 years ago

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.

by Bruno Renié, 14 years ago

Attachment: 10843.patch added

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

comment:7 by Jacob, 14 years ago

Resolution: fixed
Status: newclosed

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

comment:8 by Tom Aratyn, 14 years ago

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 by Chris Beaven, 13 years ago

Severity: Release blocker
Type: Bug

Increasing severity, working tests are paramount.

comment:10 by patchhammer, 13 years ago

Easy pickings: unset
Patch needs improvement: set

10843.patch fails to apply cleanly on to trunk

comment:11 by Luke Plant, 13 years ago

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