def test_distance_function_return_None_if_invalid_coord(self):
        self.assertEqual(
            'None',
            template.render(
                self.hass,
                '{{ distance("123", "abc") }}'))

        self.assertEqual(
            'None',
            template.render(
                self.hass,
                '{{ distance("123") }}'))

        self.hass.states.set('test.object_2', 'happy', {
            'latitude': self.hass.config.latitude,
            'longitude': self.hass.config.longitude,
        })

        self.assertEqual(
            'None',
            template.render(
                self.hass,
                '{{ distance("123", states.test_object_2) }}'))
.
dataset/ETHPy150Open home-assistant/home-assistant/tests/helpers/test_template.py/TestUtilTemplate.test_distance_function_return_None_if_invalid_coord