jinja2.tests

jinja2.tests

Jinja test functions. Used with the “is” operator.

copyright:
  1. 2010 by the Jinja Team.
license:

BSD, see LICENSE for more details.

Functions

test_callable callable(object) -> bool
test_defined(value) Return true if the variable is defined: ..
test_divisibleby(value, num) Check if a variable is divisible by a number.
test_escaped(value) Check if the value is escaped.
test_even(value) Return true if the variable is even.
test_iterable(value) Check if it’s possible to iterate over an object.
test_lower(value) Return true if the variable is lowercased.
test_mapping(value) Return true if the object is a mapping (dict etc.).
test_none(value) Return true if the variable is none.
test_number(value) Return true if the variable is a number.
test_odd(value) Return true if the variable is odd.
test_sameas(value, other) Check if an object points to the same memory address than another object: ..
test_sequence(value) Return true if the variable is a sequence.
test_string(value) Return true if the object is a string.
test_undefined(value) Like defined() but the other way round.
test_upper(value) Return true if the variable is uppercased.

Defined

  • MappingType
  • TESTS
  • Undefined
  • number_re
  • re
  • regex_type

Table Of Contents

Previous topic

unsafe

Next topic

test_callable