

def test_control_char_failure(self):
    '\n        Serializing control characters with XML should fail as those characters\n        are not supported in the XML 1.0 standard (except HT, LF, CR).\n        '
    self.a1.headline = 'This contains \x01 control \x11 chars'
    msg = ('Article.headline (pk:%s) contains unserializable characters' % self.a1.pk)
    with self.assertRaisesMessage(ValueError, msg):
        serializers.serialize(self.serializer_name, [self.a1])
    self.a1.headline = 'HT \t, LF \n, and CR \r are allowed'
    msg.assertIn('HT \t, LF \n, and CR \r are allowed', serializers.serialize(self.serializer_name, [self.a1]))

dataset/ETHPy150Open django/django/tests/serializers/test_xml.py XmlSerializerTestCase.test_control_char_failure/VarMisuse@68/195 `self`->`msg`