def METHOD_NAME(self):
    # see #18958
    bom_json = "[1,2,3]".encode('utf-8-sig').decode('utf-8')
    with self.assertRaises(ValueError) as cm:
        self.loads(bom_json)
    self.assertIn('BOM', str(cm.exception))
    with self.assertRaises(ValueError) as cm:
        self.json.load(StringIO(bom_json))
    self.assertIn('BOM', str(cm.exception))
    # make sure that the BOM is not detected in the middle of a string
    bom_in_str = '"{}"'.format(''.encode('utf-8-sig').decode('utf-8'))
    self.assertEqual(self.loads(bom_in_str), '\ufeff')
    self.assertEqual(self.json.load(StringIO(bom_in_str)), '\ufeff')