def assertNotContains(self, response, text, status_code=200,
                          msg_prefix='', html=False):

        # If the response supports deferred rendering and hasn't been rendered
        # yet, then ensure that it does get rendered before proceeding further.
        if (hasattr(response, 'render') and callable(response.render)
            and not response.is_rendered):
            response.render()

        if msg_prefix:
            msg_prefix += ": "

        self.assertEqual(response.status_code, status_code,
            msg_prefix + "Couldn't retrieve content: Response code was %d"
            " (expected %d)" % (response.status_code, status_code))
        text = force_text(text, encoding=response._charset)
        content = response.content.decode(response._charset)
        if html:
            content = assert_and_parse_html(self, content, None,
                'Response\'s content is not valid HTML:')
            text = assert_and_parse_html(self, text, None,
                'Second argument is not valid HTML:')
        self.assertEqual(content.count(text), 0,
            msg_prefix + "Response should not contain '%s'" % text)
Asserts that a response indicates that some content was retrieved
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/django/test/testcases.py/TransactionTestCase.assertNotContains