def _test_for_expected_error(self, Cls, loc, expected):
        try:
            Cls(loc=loc).validate()
            self.fail('Should not validate the location {0}'.format(loc))
        except __HOLE__ as e:
            self.assertEqual(expected, e.to_dict()['loc'])
dataset/ETHPy150Open MongoEngine/mongoengine/tests/fields/geo.py/GeoFieldTest._test_for_expected_error