summaryrefslogtreecommitdiff
path: root/tests/template_backends
Commit message (Collapse)AuthorAgeFilesLines
* Refs #33476 -- Applied Black's 2023 stable style.David Smith2023-02-013-3/+0
| | | | | | | | Black 23.1.0 is released which, as the first release of the year, introduces the 2023 stable style. This incorporates most of last year's preview style. https://github.com/psf/black/releases/tag/23.1.0
* Fixed #33639 -- Enabled cached template loader in development.Carlton Gibson2022-04-191-21/+19
|
* Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak2022-02-071-2/+6
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-074-203/+250
|
* Refs #32800 -- Avoided use of _does_token_match() in some CSRF tests.Chris Jerdonek2021-11-161-2/+8
|
* Refs #32800 -- Renamed _compare_masked_tokens() to _does_token_match().Chris Jerdonek2021-08-031-1/+1
|
* Fixed #27827 -- Used "raise from" when raising InvalidTemplateLibrary ↵Jacob Walls2020-12-281-1/+2
| | | | | | | exceptions in get_package_libraries(). This change sets the __cause__ attribute to raised exceptions and makes small cleanups in error messages.
* Refs #30116 -- Simplified regex match group access with Match.__getitem__().Jon Dufresne2020-05-111-1/+1
| | | | | The method has been available since Python 3.6. The shorter syntax is also marginally faster.
* Fixed #31291 -- Renamed salt to mask for CSRF tokens.Ram Rachum2020-02-251-1/+1
|
* Refs #26601 -- Deprecated passing None as get_response arg to middleware ↵Claude Paroz2020-02-181-2/+2
| | | | | | | | | classes. This is the new contract since middleware refactoring in Django 1.10. Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
* Fixed #30425 -- Handled jinja2.TemplateSyntaxError when rendering a template.Hasan Ramezani2019-11-272-1/+38
| | | | | Jinja raises jinja2.TemplateSyntaxError in render() not in get_template() when it's in an included template.
* Refs #29983 -- Added support for using pathlib.Path in all settings.Jon Dufresne2019-11-072-0/+23
|
* Made reused RequestFactory instances class attributes.Simon Charette2018-11-271-2/+3
|
* Fixed #29038 -- Removed closing slash from HTML void tags.Jon Dufresne2018-01-211-1/+1
|
* Fixed spelling of "nonexistent".Tim Graham2017-02-031-2/+2
|
* Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand2017-01-251-1/+1
|
* Refs #23919 -- Simplified assertRaisesRegex()'s that accounted for Python 2.Tim Graham2017-01-201-2/+2
|
* Refs #23919 -- Removed encoding preambles and future importsClaude Paroz2017-01-182-8/+0
|
* Fixed #27258 -- Prohibited django.Template.render() with non-dict context.Shivang Bharadwaj2016-12-281-1/+19
| | | Thanks Shivang Bharadwaj for the initial patch.
* Used assertRaisesMessage() in template_backends tests.Tim Graham2016-12-151-15/+16
|
* Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.za2016-11-101-2/+2
|
* Fixed #25788 -- Enabled the cached template loader if debug is False.Tim Graham2016-09-031-0/+15
|
* Fixed #24694 -- Added support for context_processors to Jinja2 backend.Berker Peksag2016-06-281-1/+16
|
* Fixed #26747 -- Used more specific assertions in the Django test suite.Jon Dufresne2016-06-161-3/+3
|
* Fixed #20869 -- made CSRF tokens change every request by salt-encrypting themShai Berger2016-05-191-6/+9
| | | | | | | | | | | | | | | Note that the cookie is not changed every request, just the token retrieved by the `get_token()` method (used also by the `{% csrf_token %}` tag). While at it, made token validation strict: Where, before, any length was accepted and non-ASCII chars were ignored, we now treat anything other than `[A-Za-z0-9]{64}` as invalid (except for 32-char tokens, which, for backwards-compatibility, are accepted and replaced by 64-char ones). Thanks Trac user patrys for reporting, github user adambrenecki for initial patch, Tim Graham for help, and Curtis Maloney, Collin Anderson, Florian Apolloner, Markus Holtermann & Jon Dufresne for reviews.
* Fixed #25469 -- Added autoescape option to DjangoTemplates backend.Aaron Elliot Ross2015-11-121-0/+22
| | | | Thanks Aymeric for the initial patch and Carl for review.
* Removed support for passing a context to a generic Template.render().Tim Graham2015-09-231-20/+1
| | | | Per deprecation timeline; refs a3e783fe11dd25bbf84bfb6201186566ed473506.
* Renamed RemovedInDjangoXYWarnings for new roadmap.Tim Graham2015-06-241-2/+2
| | | | | Forwardport of ae1d663b7913f6da233c55409c4973248372d302 from stable/1.8.x plus more.
* Fixed #17085, #24783 -- Refactored template library registration.Preston Timmons2015-05-2112-1/+87
| | | | | | * Converted the ``libraries`` and ``builtins`` globals of ``django.template.base`` into properties of the Engine class. * Added a public API for explicit registration of libraries and builtins.
* Refs #24652 -- Made sure template backend tests call their super setUpClass.Simon Charette2015-05-201-0/+1
|
* Fixed #24119, #24120 -- Formalized debug integration for template backends.Preston Timmons2015-05-063-1/+75
|
* Fixed #24685 -- Fixed check for template name unicity.Aymeric Augustin2015-05-031-0/+9
| | | | Thanks Preston Timmons for the report.
* Refs #24538 -- Simplified a test per Aymeric's feedback.Tim Graham2015-04-011-9/+2
|
* Fixed #24538 -- Allowed self in Jinja contextTim Heap2015-04-011-0/+18
| | | | | | Rendering a Jinja template with self in the context threw an error. While self is a reserved variable in Jinja, including self in the context is not an error, so Django should respect that.
* Refs #24469 -- Fixed escaping of forms, fields, and media in non-Django ↵Moritz Sichert2015-03-183-1/+28
| | | | templates.
* Sorted imports with isort; refs #23860.Tim Graham2015-02-062-5/+5
|
* Fixed #24265 -- Preserved template backend loading exceptions.Aymeric Augustin2015-02-051-0/+37
| | | | | If importing or initializing a template backend fails, attempting to access this template backend again must raise the same exception.
* Removed compatibility with Python 3.2.Tim Graham2015-01-171-12/+5
|
* Deprecated passing a Context to a generic Template.render.Aymeric Augustin2015-01-121-1/+20
| | | | | | | | | | | A deprecation path is required because the return type of django.template.loader.get_template changed during the multiple template engines refactor. test_csrf_token_in_404 was incorrect: it tested the case when the hardcoded template was rendered, and that template doesn't depend on the CSRF token. This commit makes it test the case when a custom template is rendered.
* Rewrapped TemplateSyntaxError in Jinja2 backend.Aymeric Augustin2015-01-123-1/+11
| | | | | Changed import style to avoid confusion between Django's and Jinja2's APIs.
* Made context take priority over context processors.Aymeric Augustin2015-01-061-0/+25
| | | | | | | | | This is the expected behavior, but given RequestContext's tortuous implementation, a straightforward use of its API results in the opposite. This commits fixes a regression that must have happened at different points in the multiple templates engine refactor for different features.
* Silenced an ImportWarning in the template_backends tests.Tim Graham2015-01-011-0/+4
|
* Added basic tests for template backends.Aymeric Augustin2014-12-2811-0/+112