'Test now method.'

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

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