summaryrefslogtreecommitdiff
path: root/tests/test_api.py
Commit message (Collapse)AuthorAgeFilesLines
* don't finalize TemplateData nodesno-finalize-template-dataDavid Lord2019-10-121-10/+47
| | | | | Finalize only applies to the output of expressions (constant or not). Add tests for context, eval, and env finalize functions.
* Replaced try...catch within tests with pytest.raisespytest-cleanupKevin Brown2019-10-101-10/+2
| | | | | | This still leaves one in test_debug which relies on reading out the traceback and cannot easily be replaced by pytest.raises like the others.
* Eliminate dead code by using pytests.raises instead of try/except/elsebtharper2019-10-061-5/+1
|
* Add tests for Undefined classesEtiennePelletier2019-10-041-0/+15
|
* Merge branch '2.10.x'David Lord2019-07-261-0/+9
|\
| * sandbox uses xrange on Python 2Prakhar Bhandari2019-07-221-1/+10
| |
* | exclude globals from find_undeclared_variablesBrendan2019-07-221-0/+4
| |
* | Add ChainableUndefined allowing getattr & getitem (#997)Étienne Pelletier2019-05-081-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add ChainableUndefined allowing getattr & getitem Allows using default values with chains of items or attributes that may contain undefined values without raising a jinja2.exceptions.UndefinedError. >>> import jinja2 >>> env = jinja2.Environment(undefined=jinja2.ChainableUndefined) >>> env.from_string("{{ foo.bar['baz'] | default('val') }}").render() 'val' * Remove class decorator from ChainableUndefined
* | Trim trailing white space throughout the projectJon Dufresne2018-08-291-1/+1
|/ | | | | | Many editors clean up trailing white space on save. By removing it all in one go, it helps keep future diffs cleaner by avoiding spurious white space changes on unrelated lines.
* Bump up the copyright to 2017Armin Ronacher2017-01-071-1/+1
|
* Cleaned up shitty syntax in testsuiteArmin Ronacher2017-01-061-5/+5
|
* Fixed various breakage from the new id trackingArmin Ronacher2017-01-031-1/+1
|
* Merge pull request #530 from nick-garcia/masterArmin Ronacher2017-01-031-0/+2
|\ | | | | Subtraction from Undefined does not raise UndefinedError
| * Setting __sub__ equal to _fail_with_undefined_error so subtractions withNick Garcia2016-01-071-0/+2
| | | | | | | | undefined variables will fail properly like other arithemtic operations.
* | Give Cycler a next() method so that it works in python2 and 3Matt Haggard2015-12-291-0/+11
|/
* Let the Environment override the ContextThiefMaster2015-04-061-0/+13
| | | | closes #404
* Let the Environment override the CodeGeneratorThiefMaster2015-04-061-0/+22
| | | | see #404
* Rename testsuite to tests and suggestionsKartheek Lenkala2015-03-221-0/+292
Remove py.test from setup.py install_requires Rename testsuite folder to tests.