'Test distance function return None if invalid state.'

def test_distance_function_return_None_if_invalid_state(self):

    self.hass.states.set('test.object_2', 'happy', {'latitude': 10})
    tpl = template.Template('{{    distance(states.test.object_2)    |    round    }}', self.hass)
    self.assertEqual('None', tpl.render())
