def METHOD_NAME(self):
    context = EvaluationContext({'domain': self.domain})
    expression = ExpressionFactory.from_spec({
        'type': 'ancestor_location',
        'location_id': self.city.location_id,
        'location_type': "continent",
    })
    ancestor_location = expression({}, context)
    self.assertIsNotNone(ancestor_location)
    self.assertEqual(
        ancestor_location.get("location_id"),
        self.continent.location_id
    )