'Nonexistent stream name with bad characters should be escaped properly.'

def test_message_to_nonexistent_stream_with_bad_characters(self):

    self.login(self.example_email('hamlet'))
    self.assertFalse(Stream.objects.filter(name='&<"\'><non-existent>'))
    result = self.client_post('/json/messages', {'type': 'stream', 'to': '&<"\'><non-existent>', 'client': 'test    suite', 'content': 'Test    message', 'subject': 'Test    subject'})
    self.assert_json_error(result, "Stream    '&amp;&lt;&quot;&#39;&gt;&lt;non-existent&gt;'    does    not    exist")
