'Asserts that a response indicates that some content was retrieved
successfully, (i.e., the HTTP status code was as expected), and that
``text`` doesn\'t occurs in the content of the response.'

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

    if (hasattr(response, u'render') and callable(response.render) and (not response.is_rendered)):
        response.render()
    if msg_prefix:
        msg_prefix += u':    '
    self.assertEqual(response.status_code, status_code, (msg_prefix + (u"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, u"Response's    content    is    not    valid    HTML:")
        text = assert_and_parse_html(self, text, None, u'Second    argument    is    not    valid    HTML:')
    self.assertEqual(content.count(text), 0, (msg_prefix + (u"Response    should    not    contain    '%s'" % text)))
