Fixed #34657 -- Made assert(Not)Contains/assertInHTML display haystacks in error messages.

This commit is contained in:
Chinmoy Chakraborty 2023-10-02 23:16:21 +05:30 committed by Mariusz Felisiak
parent 54d9d26ebf
commit 1dae65dc63
5 changed files with 157 additions and 31 deletions

View file

@ -1700,6 +1700,10 @@ your test suite.
attribute ordering is not significant. See
:meth:`~SimpleTestCase.assertHTMLEqual` for more details.
.. versionchanged:: 5.1
In older versions, error messages didn't contain the response content.
.. method:: SimpleTestCase.assertNotContains(response, text, status_code=200, msg_prefix='', html=False)
Asserts that a :class:`response <django.http.HttpResponse>` produced the
@ -1712,6 +1716,10 @@ your test suite.
attribute ordering is not significant. See
:meth:`~SimpleTestCase.assertHTMLEqual` for more details.
.. versionchanged:: 5.1
In older versions, error messages didn't contain the response content.
.. method:: SimpleTestCase.assertTemplateUsed(response, template_name, msg_prefix='', count=None)
Asserts that the template with the given name was used in rendering the
@ -1848,6 +1856,10 @@ your test suite.
Whitespace in most cases is ignored, and attribute ordering is not
significant. See :meth:`~SimpleTestCase.assertHTMLEqual` for more details.
.. versionchanged:: 5.1
In older versions, error messages didn't contain the ``haystack``.
.. method:: SimpleTestCase.assertJSONEqual(raw, expected_data, msg=None)
Asserts that the JSON fragments ``raw`` and ``expected_data`` are equal.