diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-10-21 15:48:40 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-10-21 15:48:40 +0000 |
| commit | 6fbf653aa5aa15867e03a5c60bda599d5c99123c (patch) | |
| tree | 9667ac06e3f279455c47f45ff80d5eb90e53fbf9 /tests | |
| parent | c64a6c98c49ab8f45ee50daa2cfefccf96dd3716 (diff) | |
Fixed #1065 -- Added a "cache" template tag. Thanks, Ian Maurer and, particularly, Nick Lane.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6580 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/regressiontests/templates/tests.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/regressiontests/templates/tests.py b/tests/regressiontests/templates/tests.py index a011248210..b0d4957fbb 100644 --- a/tests/regressiontests/templates/tests.py +++ b/tests/regressiontests/templates/tests.py @@ -805,6 +805,20 @@ class Templates(unittest.TestCase): 'url-fail01' : ('{% url %}', {}, template.TemplateSyntaxError), 'url-fail02' : ('{% url no_such_view %}', {}, ''), 'url-fail03' : ('{% url regressiontests.templates.views.client no_such_param="value" %}', {}, ''), + + ### CACHE TAG ###################################################### + 'cache01' : ('{% load cache %}{% cache -1 test %}cache01{% endcache %}', {}, 'cache01'), + 'cache02' : ('{% load cache %}{% cache -1 test %}cache02{% endcache %}', {}, 'cache02'), + 'cache03' : ('{% load cache %}{% cache 2 test %}cache03{% endcache %}', {}, 'cache03'), + 'cache04' : ('{% load cache %}{% cache 2 test %}cache04{% endcache %}', {}, 'cache03'), + 'cache05' : ('{% load cache %}{% cache 2 test foo %}cache05{% endcache %}', {'foo': 1}, 'cache05'), + 'cache06' : ('{% load cache %}{% cache 2 test foo %}cache06{% endcache %}', {'foo': 2}, 'cache06'), + 'cache07' : ('{% load cache %}{% cache 2 test foo %}cache06{% endcache %}', {'foo': 1}, 'cache05'), + + # Raise exception if we dont have at least 2 args, first one integer. + 'cache08' : ('{% load cache %}{% cache %}{% endcache %}', {}, template.TemplateSyntaxError), + 'cache09' : ('{% load cache %}{% cache 1 %}{% endcache %}', {}, template.TemplateSyntaxError), + 'cache10' : ('{% load cache %}{% cache foo bar %}{% endcache %}', {}, template.TemplateSyntaxError), } # Register our custom template loader. |
