Opened 6 years ago

Closed 4 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)

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 arthurk 6 years ago.
ticket10843.diff (1.0 KB) - added by arthurk 6 years ago.
10843.patch (589 bytes) - added by brutasse 5 years ago.
Patch without version check, just removes tabs from the rendered text

Download all attachments as: .zip

Change History (14)

comment:1 Changed 6 years ago by Alex

  • Description modified (diff)
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Please use preview.

Changed 6 years ago by arthurk

comment:2 Changed 6 years ago by arthurk

  • Has patch set

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

comment:3 Changed 6 years ago by kmtracey

  • 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 6 years ago by arthurk

comment:4 Changed 6 years ago by arthurk

  • 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 6 years ago by Alex

  • Triage Stage changed from Unreviewed to Accepted

comment:6 Changed 5 years ago by brutasse

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 5 years ago by brutasse

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

comment:7 Changed 5 years ago by jacob

  • Resolution set to fixed
  • Status changed from new to closed

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

comment:8 Changed 5 years ago by themystic

  • Resolution fixed deleted
  • Status changed from closed to reopened

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 4 years ago by SmileyChris

  • Severity set to Release blocker
  • Type set to Bug

Increasing severity, working tests are paramount.

comment:10 Changed 4 years ago by patchhammer

  • Easy pickings unset
  • Patch needs improvement set

10843.patch fails to apply cleanly on to trunk

comment:11 Changed 4 years ago by lukeplant

  • Resolution set to fixed
  • Severity changed from Release blocker to Normal
  • Status changed from reopened to closed

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