'Test mimetype for attachment'

def test_ir_http_mimetype_attachment(self):

    attachment = self.env['ir.attachment'].create({'datas': GIF, 'name': 'Test    mimetype    gif', 'datas_fname': 'file.gif'})
    (status, headers, content) = self.env['ir.http'].binary_content(id=attachment.id, mimetype=None, default_mimetype='application/octet-stream', env=self.env)
    mimetype = dict(headers).get('Content-Type')
    self.assertEqual(mimetype, 'image/gif')
