assertXMLEqual behaviour

13 views
Skip to first unread message

Jon Dunleavy

unread,
Apr 30, 2014, 5:17:22 AM4/30/14
to django...@googlegroups.com
Hi,

I am using django 1.6 but I can't find any information on the bugtracker as to whether this has changed but is this intentional behaviour of assertXMLEqual:

# this passes
self.assertXMLEqual(
    "<test><test>Value</test></test>",
    """<test><test>Value</test></test>""",
)

# this fails
self.assertXMLEqual(
    "<test><test>Value</test></test>",
    """<test>
        <test>Value</test>
    </test>""",
)

Thanks,


James Bennett

unread,
Apr 30, 2014, 7:53:57 AM4/30/14
to django...@googlegroups.com
As far as I can tell from reading the source, there's no deliberate intention one way or another.

However, from a strict/pedantic point of view, the example you give is demonstrating correct behavior; due to whitespace, the second document contains nodes not present in the first one.
Reply all
Reply to author
Forward
0 new messages