'Test utcnow method.'

@patch('homeassistant.helpers.template.TemplateEnvironment.is_safe_callable', return_value=True)
def test_utcnow(self, mock_is_safe):

    now = dt_util.utcnow()
    with patch.dict(template.ENV.globals, {'utcnow': (lambda : now)}):
        self.assertEqual(now.isoformat(), template.Template('{{    utcnow().isoformat()    }}', self.hass).render())
