Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for 2.7.2 references "equalto" test not included in release 2.7.2 #329

Closed
colstrom opened this issue May 12, 2014 · 5 comments

Comments

@colstrom
Copy link

Title explains the issue, but here's a few snippets to confirm it.

pip shows Jinja2 as INSTALLED: 2.7.2 (latest)

  File "/usr/local/lib/python2.7/dist-packages/jinja2/filters.py", line 740, in do_list
    return list(value)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/filters.py", line 839, in do_map
    for item in seq:
  File "/usr/local/lib/python2.7/dist-packages/jinja2/filters.py", line 931, in _select_or_reject
    if modfunc(func(transfunc(item))):
  File "/usr/local/lib/python2.7/dist-packages/jinja2/filters.py", line 925, in <lambda>
    name, item, args, kwargs)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 438, in call_test
    raise TemplateRuntimeError('no test named %r' % name)
TemplateRuntimeError: no test named 'equalto'

Checking /usr/local/lib/python2.7/dist-packages/jinja2/tests.py

TESTS = {
    'odd':              test_odd,
    'even':             test_even,
    'divisibleby':      test_divisibleby,
    'defined':          test_defined,
    'undefined':        test_undefined,
    'none':             test_none,
    'lower':            test_lower,
    'upper':            test_upper,
    'string':           test_string,
    'mapping':          test_mapping,
    'number':           test_number,
    'sequence':         test_sequence,
    'iterable':         test_iterable,
    'callable':         test_callable,
    'sameas':           test_sameas,
    'escaped':          test_escaped
}

Merging 27ffd01 resolves this issue.

@mitsuhiko
Copy link
Contributor

New release soon, then you will have that function.

@colstrom
Copy link
Author

colstrom commented Jun 8, 2014

Intended as part of 2.7.3 or coming in 2.7.4?

Because looking at jinja2/tests.py in 2.7.3, test_equalto is still not defined.

@deoxxa
Copy link

deoxxa commented Aug 8, 2014

Yep, awesome. Lost a bit of time on this. If it's not available, why is it documented and presented as available?

Edit: see, here it is.

Does the documentation describe an ideal implementation of Jinja2? Like some kind of alternate universe version? If so, you seem to be doing a great job! This actual, concrete implementation is really close to what's documented!

@BillyMorgan
Copy link

3 tiny words that would have prevented me wasting the last hour of my life... "development version only"

@untitaker
Copy link
Contributor

I agree that the current docs situation is less than ideal, but there is a warning on top of each page saying that this is a development version.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants