Discussion:
[Django] #25170: assertXMLEqual fails when white space is present outside XML fragment
Django
2015-07-23 20:19:38 UTC
Permalink
#25170: assertXMLEqual fails when white space is present outside XML fragment
-----------------------------------+--------------------
Reporter: shelldweller | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: 1.8
Severity: Normal | Keywords: test
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------------+--------------------
Currently this test fails:

{{{#!python
class MyTestCase(TestCase):
def test_xml(self):
self.assertXMLEqual('<greeting>hello</greeting>',
'<greeting>hello</greeting>\n')
}}}

I believe this is a bug because white space outside root tag should not
matter. It makes testing rather confusing when reading XML documents from
files (which may or may not have trailing new line characters).

--
Ticket URL: <https://code.djangoproject.com/ticket/25170>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/055.101a5a61449ec561e8cdfd7243a0479d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Django
2015-07-23 22:51:28 UTC
Permalink
#25170: assertXMLEqual fails when white space is present outside XML fragment
-----------------------------------+------------------------------------
Reporter: shelldweller | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: test | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by timgraham):

* needs_better_patch: => 0
* needs_docs: => 0
* version: 1.8 => master
* needs_tests: => 0
* stage: Unreviewed => Accepted


Comment:

Seems reasonable as the docstring says "Whitespace in most cases is
ignored".

--
Ticket URL: <https://code.djangoproject.com/ticket/25170#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.b37814e80da8c13dd3d59fe891c1970e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Django
2015-07-25 09:12:46 UTC
Permalink
#25170: assertXMLEqual fails when white space is present outside XML fragment
-----------------------------------+------------------------------------
Reporter: shelldweller | Owner: quamilek
Type: Bug | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: test | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by quamilek):

* owner: nobody => quamilek
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/25170#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.f7b8dfd77d335e86f967352d4bee0b1e%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Django
2015-07-26 11:59:30 UTC
Permalink
#25170: assertXMLEqual fails when white space is present outside XML fragment
-----------------------------------+------------------------------------
Reporter: shelldweller | Owner: quamilek
Type: Bug | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: test | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------------+------------------------------------

Comment (by mishunika):

At the time of analyzing the issue, I didn't notice that the issue is
already assigned. Anyway, just because the fix seems so simple, and there
is no pull request yet, I published my own solution as a PR.

The fixed branch is available here:
https://github.com/mishunika/django/tree/ticket_25170
And the PR is here: https://github.com/django/django/pull/5049

--
Ticket URL: <https://code.djangoproject.com/ticket/25170#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.8aa5bb333f9584c04e6acd8961a7b406%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Django
2015-07-27 06:17:53 UTC
Permalink
#25170: assertXMLEqual fails when white space is present outside XML fragment
-----------------------------------+------------------------------------
Reporter: shelldweller | Owner: quamilek
Type: Bug | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: test | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------------+------------------------------------

Comment (by quamilek):

I started working on this bug after assigned.
This is PR for this issue: https://github.com/django/django/pull/5052
Resolution of this bug is different then @mishunika.

--
Ticket URL: <https://code.djangoproject.com/ticket/25170#comment:4>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.2eace9941240121078752ad3be295994%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Django
2015-07-30 22:31:25 UTC
Permalink
#25170: assertXMLEqual fails when white space is present outside XML fragment
-----------------------------------+------------------------------------
Reporter: shelldweller | Owner: quamilek
Type: Bug | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: test | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by timgraham):

* has_patch: 0 => 1


Comment:

I think [https://github.com/django/django/pull/5052 PR 5052] is more
correct in that it will continue to consider whitespace *inside* a tag
significant; e.g. the following snippets shouldn't be considered equal:
{{{
<tag>foo </tag>
<tag>foo</tag>
}}}
Anyone to confirm that? The author of
[https://github.com/django/django/pull/5049 PR 5049] argues otherwise.

--
Ticket URL: <https://code.djangoproject.com/ticket/25170#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups "Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+***@googlegroups.com.
To post to this group, send email to django-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/070.822418f23bdcf3ac251a48fa2315dae0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Loading...