Opened 16 years ago
Closed 14 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 )
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 “quotes” and <code>code</code></p>""") AssertionError: u'<p>Paragraph 1</p>\n\n\t<p>Paragraph 2 with “quotes” and <code>code</code></p>' != '<p>Paragraph 1</p>\n\n<p>Paragraph 2 with “quotes” and <code>code</code></p>' ----------------------------------------------------------------------
Looks like there is an extra "\t" in there before the "Paragraph 2" <p> element.
Attachments (3)
Change History (14)
comment:1 by , 16 years ago
Description: | modified (diff) |
---|
by , 16 years ago
Attachment: | ticket10843.patch added |
---|
comment:3 by , 16 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 , 16 years ago
Attachment: | ticket10843.diff added |
---|
comment:4 by , 16 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 , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:6 by , 15 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 , 15 years ago
Attachment: | 10843.patch added |
---|
Patch without version check, just removes tabs from the rendered text
comment:7 by , 15 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:8 by , 14 years ago
Resolution: | fixed |
---|---|
Status: | closed → 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 “quotes” and <code>code</code></p>""") AssertionError: u'<p>Paragraph 1</p>\n\n\t<p>Paragraph 2 with “quotes” and <code>code</code></p>' != '<p>Paragraph 1\ </p>\n\n<p>Paragraph 2 with “quotes” and <code>code</code></p>' ----------------------------------------------------------------------
Removing the textile egg resolves the issue (since I don't need textile for anything).
comment:9 by , 14 years ago
Severity: | → Release blocker |
---|---|
Type: | → Bug |
Increasing severity, working tests are paramount.
comment:10 by , 14 years ago
Easy pickings: | unset |
---|---|
Patch needs improvement: | set |
10843.patch fails to apply cleanly on to trunk
comment:11 by , 14 years ago
Resolution: | → fixed |
---|---|
Severity: | Release blocker → Normal |
Status: | reopened → 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.
Please use preview.