
import pytest

from jinja2 import Environment


@pytest.fixture(scope='session')
def environment():
    return Environment(extensions=['jinja2_time.TimeExtension'])


def test_foobar(environment):
    assert environment


from freezegun import freeze_time
from jinja2 import Environment, exceptions
import pytest


@pytest.fixture(scope='session')
def environment():
    return Environment(extensions=['jinja2_time.TimeExtension'])


def test_tz_is_required(environment):
    with pytest.raises(exceptions.TemplateSyntaxError):
        environment.from_string('{% now %}')


@freeze_time("2015-12-09 23:33:01")
def test_default_datetime_format(environment):
    template = environment.from_string("{% now 'utc' %}")

    assert template.render() == "2015-12-09"

Implement a test for the extensions default datetime format
Implement a test for the extensions default datetime format

  
+ from freezegun import freeze_time
+ from jinja2 import Environment, exceptions
  import pytest
- 
- from jinja2 import Environment
  
  
  @pytest.fixture(scope='session')
  def environment():
      return Environment(extensions=['jinja2_time.TimeExtension'])
  
  
- def test_foobar(environment):
-     assert environment
+ def test_tz_is_required(environment):
+     with pytest.raises(exceptions.TemplateSyntaxError):
+         environment.from_string('{% now %}')
  
+ 
+ @freeze_time("2015-12-09 23:33:01")
+ def test_default_datetime_format(environment):
+     template = environment.from_string("{% now 'utc' %}")
+ 
+     assert template.render() == "2015-12-09"
+ 
Implement a test for the extensions default datetime format
## Code Before:

import pytest

from jinja2 import Environment


@pytest.fixture(scope='session')
def environment():
    return Environment(extensions=['jinja2_time.TimeExtension'])


def test_foobar(environment):
    assert environment

## Instruction:
Implement a test for the extensions default datetime format
## Code After:

from freezegun import freeze_time
from jinja2 import Environment, exceptions
import pytest


@pytest.fixture(scope='session')
def environment():
    return Environment(extensions=['jinja2_time.TimeExtension'])


def test_tz_is_required(environment):
    with pytest.raises(exceptions.TemplateSyntaxError):
        environment.from_string('{% now %}')


@freeze_time("2015-12-09 23:33:01")
def test_default_datetime_format(environment):
    template = environment.from_string("{% now 'utc' %}")

    assert template.render() == "2015-12-09"
