Assert that a response indicates that some content was retrieved successfully, (i.e., the HTTP status code was as expected) and that ``text`` doesn't occur in the content of the response.
(
self, response, text, status_code=200, msg_prefix="", html=False
)
| 628 | self.fail(msg) |
| 629 | |
| 630 | def assertNotContains( |
| 631 | self, response, text, status_code=200, msg_prefix="", html=False |
| 632 | ): |
| 633 | """ |
| 634 | Assert that a response indicates that some content was retrieved |
| 635 | successfully, (i.e., the HTTP status code was as expected) and that |
| 636 | ``text`` doesn't occur in the content of the response. |
| 637 | """ |
| 638 | real_count, msg_prefix, response_content = self._assert_contains( |
| 639 | response, text, status_code, msg_prefix, html |
| 640 | ) |
| 641 | |
| 642 | if real_count != 0: |
| 643 | text_repr = self._text_repr(text, force_string=html) |
| 644 | self.fail( |
| 645 | f"{real_count} != 0 :{msg_prefix}{text_repr} unexpectedly found in the " |
| 646 | f"following response\n{response_content!r}" |
| 647 | ) |
| 648 | |
| 649 | def _check_test_client_response(self, response, attribute, method_name): |
| 650 | """ |
no test coverage detected