'Test if state exists works.'

def test_if_state_exists(self):

    self.hass.states.set('test.object', 'available')
    tpl = template.Template('{%    if    states.test.object    %}exists{%    else    %}not    exists{%    endif    %}', self.hass)
    self.assertEqual('exists', tpl.render())
