Loading AUTHORS +2 −0 Original line number Diff line number Diff line Loading @@ -234,6 +234,7 @@ answer newbie questions, and generally made Django that much better: Fabrice Aneche <akh@nobugware.com> favo@exoweb.net fdr <drfarina@gmail.com> Federico Capoano <nemesis@ninux.org> Filip Noetzel <http://filip.noetzel.co.uk/> Filip Wasilewski <filip.wasilewski@gmail.com> Finn Gruwier Larsen <finn@gruwier.dk> Loading Loading @@ -483,6 +484,7 @@ answer newbie questions, and generally made Django that much better: Matt McClanahan <http://mmcc.cx/> Matt Riggott Matt Robenolt <m@robenolt.com> Mattia Larentis <mattia@laretis.eu> mattycakes@gmail.com Max Burstein <http://maxburstein.com> Max Derkachev <mderk@yandex.ru> Loading django/test/utils.py +3 −3 Original line number Diff line number Diff line Loading @@ -293,7 +293,7 @@ def compare_xml(want, got): """Tries to do a 'xml-comparison' of want and got. Plain string comparison doesn't always work because, for example, attribute ordering should not be important. Comment nodes are not considered in the comparison. comparison. Leading and trailing whitespace is ignored on both chunks. Based on http://codespeak.net/svn/lxml/trunk/src/lxml/doctestcompare.py """ Loading Loading @@ -338,8 +338,8 @@ def compare_xml(want, got): return node want, got = strip_quotes(want, got) want = want.replace('\\n', '\n') got = got.replace('\\n', '\n') want = want.strip().replace('\\n', '\n') got = got.strip().replace('\\n', '\n') # If the string is not a complete xml document, we may need to add a # root element. This allow us to compare fragments, like "<foo/><bar/>" Loading tests/test_utils/tests.py +10 −0 Original line number Diff line number Diff line Loading @@ -753,6 +753,16 @@ class XMLEqualTests(SimpleTestCase): xml2 = "<?xml version='1.0'?><!-- comment2 --><elem attr2='b' attr1='a' />" self.assertXMLEqual(xml1, xml2) def test_simple_equal_with_leading_or_trailing_whitespace(self): xml1 = "<elem>foo</elem> \t\n" xml2 = " \t\n<elem>foo</elem>" self.assertXMLEqual(xml1, xml2) def test_simple_not_equal_with_whitespace_in_the_middle(self): xml1 = "<elem>foo</elem><elem>bar</elem>" xml2 = "<elem>foo</elem> <elem>bar</elem>" self.assertXMLNotEqual(xml1, xml2) class SkippingExtraTests(TestCase): fixtures = ['should_not_be_loaded.json'] Loading Loading
AUTHORS +2 −0 Original line number Diff line number Diff line Loading @@ -234,6 +234,7 @@ answer newbie questions, and generally made Django that much better: Fabrice Aneche <akh@nobugware.com> favo@exoweb.net fdr <drfarina@gmail.com> Federico Capoano <nemesis@ninux.org> Filip Noetzel <http://filip.noetzel.co.uk/> Filip Wasilewski <filip.wasilewski@gmail.com> Finn Gruwier Larsen <finn@gruwier.dk> Loading Loading @@ -483,6 +484,7 @@ answer newbie questions, and generally made Django that much better: Matt McClanahan <http://mmcc.cx/> Matt Riggott Matt Robenolt <m@robenolt.com> Mattia Larentis <mattia@laretis.eu> mattycakes@gmail.com Max Burstein <http://maxburstein.com> Max Derkachev <mderk@yandex.ru> Loading
django/test/utils.py +3 −3 Original line number Diff line number Diff line Loading @@ -293,7 +293,7 @@ def compare_xml(want, got): """Tries to do a 'xml-comparison' of want and got. Plain string comparison doesn't always work because, for example, attribute ordering should not be important. Comment nodes are not considered in the comparison. comparison. Leading and trailing whitespace is ignored on both chunks. Based on http://codespeak.net/svn/lxml/trunk/src/lxml/doctestcompare.py """ Loading Loading @@ -338,8 +338,8 @@ def compare_xml(want, got): return node want, got = strip_quotes(want, got) want = want.replace('\\n', '\n') got = got.replace('\\n', '\n') want = want.strip().replace('\\n', '\n') got = got.strip().replace('\\n', '\n') # If the string is not a complete xml document, we may need to add a # root element. This allow us to compare fragments, like "<foo/><bar/>" Loading
tests/test_utils/tests.py +10 −0 Original line number Diff line number Diff line Loading @@ -753,6 +753,16 @@ class XMLEqualTests(SimpleTestCase): xml2 = "<?xml version='1.0'?><!-- comment2 --><elem attr2='b' attr1='a' />" self.assertXMLEqual(xml1, xml2) def test_simple_equal_with_leading_or_trailing_whitespace(self): xml1 = "<elem>foo</elem> \t\n" xml2 = " \t\n<elem>foo</elem>" self.assertXMLEqual(xml1, xml2) def test_simple_not_equal_with_whitespace_in_the_middle(self): xml1 = "<elem>foo</elem><elem>bar</elem>" xml2 = "<elem>foo</elem> <elem>bar</elem>" self.assertXMLNotEqual(xml1, xml2) class SkippingExtraTests(TestCase): fixtures = ['should_not_be_loaded.json'] Loading