'HttpResponse should encode based on charset.'

def test_response_content_charset(self):

    content = 'Caf\xc3\xa9    :)'
    utf8_content = content.encode(UTF8)
    iso_content = content.encode(ISO88591)
    response = HttpResponse(utf8_content)
    self.assertContains(response, utf8_content)
    response = HttpResponse(iso_content, content_type=('text/plain;    charset=%s' % ISO88591))
    self.assertContains(response, iso_content)
    response = HttpResponse(iso_content)
    self.assertContains(response, iso_content)
    response = HttpResponse(iso_content, content_type='text/plain')
    self.assertContains(response, iso_content)
