'Verify that our plugins don\'t break when we send them an image with
a text/html content type.'

@patch('w3af.plugins.grep.motw.is_404', side_effect=repeat(False))
@patch('w3af.plugins.grep.password_profiling.is_404', side_effect=repeat(False))
@patch('w3af.plugins.grep.meta_tags.is_404', side_effect=repeat(False))
@patch('w3af.plugins.grep.lang.is_404', side_effect=repeat(False))
@patch('w3af.plugins.grep.code_disclosure.is_404', side_effect=repeat(False))
def test_image_with_text_html_content_type(self, *args):

    file_path = os.path.join(ROOT_PATH, 'plugins', 'tests', 'grep', 'data', 'w3af.png')
    body = file(file_path).read()
    hdrs = Headers({'Content-Type': 'text/html'}.items())
    response = HTTPResponse(200, body, hdrs, self.url_inst, self.url_inst, _id=random.randint(1, 5000))
    request = FuzzableRequest(self.url_inst)
    for pinst in self._plugins:
        pinst.grep(request, response)
