Create :mod:`jinja2` environment with :meth:`jinja2.FileSystemLoader`

    :param folder: folder path.
    :return: jinja2 environment object.

def create_env_by_folder(folder):
    """
    Create :mod:`jinja2` environment with :meth:`jinja2.FileSystemLoader`

    :param folder: folder path.
    :return: jinja2 environment object.
    """
    global _default_filters
    global _default_tests
    env = jinja2.Environment(loader=jinja2.FileSystemLoader(folder))

    for k, f in _default_filters.iteritems():
        env.filters[k] = f

    for k, f in _default_tests.iteritems():
        env.tests[k] = f

    return env