'#23593 - AdminEmailHandler should allow Unicode characters in the
request.'

@override_settings(ADMINS=[('whatever    admin', 'admin@example.com')])
def test_emit_non_ascii(self):

    handler = self.get_admin_email_handler(self.logger)
    record = self.logger.makeRecord('name', logging.ERROR, 'function', 'lno', 'message', None, None)
    rf = RequestFactory()
    url_path = '/\xc2\xba'
    record.request = rf.get(url_path)
    handler.emit(record)
    self.assertEqual(len(mail.outbox), 1)
    msg = mail.outbox[0]
    self.assertEqual(msg.to, ['admin@example.com'])
    self.assertEqual(msg.subject, '[Django]    ERROR    (EXTERNAL    IP):    message')
    self.assertIn(('Report    at    %s' % url_path), msg.body)
