'Test distance function return None if invalid coord.'

def test_distance_function_return_None_if_invalid_coord(self):

    self.assertEqual('None', template.Template('{{    distance("123",    "abc")    }}', self.hass).render())
    self.assertEqual('None', template.Template('{{    distance("123")    }}', self.hass).render())
    self.hass.states.set('test.object_2', 'happy', {'latitude': self.hass.config.latitude, 'longitude': self.hass.config.longitude})
    tpl = template.Template('{{    distance("123",    states.test_object_2)    }}', self.hass)
    self.assertEqual('None', tpl.render())
