summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/releases/1.5.txt5
-rw-r--r--docs/topics/testing.txt19
2 files changed, 24 insertions, 0 deletions
diff --git a/docs/releases/1.5.txt b/docs/releases/1.5.txt
index d87ec36204..e99b2fd578 100644
--- a/docs/releases/1.5.txt
+++ b/docs/releases/1.5.txt
@@ -198,6 +198,11 @@ Django 1.5 also includes several smaller improvements worth noting:
* The loaddata management command now supports an `ignorenonexistent` option to
ignore data for fields that no longer exist.
+* :meth:`~django.test.SimpleTestCase.assertXMLEqual` and
+ :meth:`~django.test.SimpleTestCase.assertXMLNotEqual` new assertions allow
+ you to test equality for XML content at a semantic level, without caring for
+ syntax differences (spaces, attribute order, etc.).
+
Backwards incompatible changes in 1.5
=====================================
diff --git a/docs/topics/testing.txt b/docs/topics/testing.txt
index 3950e1c917..895e721ef5 100644
--- a/docs/topics/testing.txt
+++ b/docs/topics/testing.txt
@@ -1783,6 +1783,25 @@ your test suite.
``html1`` and ``html2`` must be valid HTML. An ``AssertionError`` will be
raised if one of them cannot be parsed.
+.. method:: SimpleTestCase.assertXMLEqual(xml1, xml2, msg=None)
+
+ .. versionadded:: 1.5
+
+ Asserts that the strings ``xml1`` and ``xml2`` are equal. The
+ comparison is based on XML semantics. Similarily to
+ :meth:`~SimpleTestCase.assertHTMLEqual`, the comparison is
+ made on parsed content, hence only semantic differences are considered, not
+ syntax differences. When unvalid XML is passed in any parameter, an
+ ``AssertionError`` is always raised, even if both string are identical.
+
+.. method:: SimpleTestCase.assertXMLNotEqual(xml1, xml2, msg=None)
+
+ .. versionadded:: 1.5
+
+ Asserts that the strings ``xml1`` and ``xml2`` are *not* equal. The
+ comparison is based on XML semantics. See
+ :meth:`~SimpleTestCase.assertXMLEqual` for details.
+
.. _topics-testing-email:
Email services