diff options
| author | Preston Timmons <prestontimmons@gmail.com> | 2015-02-21 13:17:39 -0600 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@oscaro.com> | 2015-02-24 14:00:02 +0100 |
| commit | f6d087b628a61a7b036cc468328497082031dc8e (patch) | |
| tree | d1ca0bbf46ef636832d563ebbbbd0385403b591a /tests/template_tests/tests.py | |
| parent | 250a3d199310a954a95fb1ffa4915f0e51ba1767 (diff) | |
Moved cache tests into syntax_tests/test_cache.py.
Diffstat (limited to 'tests/template_tests/tests.py')
| -rw-r--r-- | tests/template_tests/tests.py | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/tests/template_tests/tests.py b/tests/template_tests/tests.py index 9d1055749c..c62d8a3147 100644 --- a/tests/template_tests/tests.py +++ b/tests/template_tests/tests.py @@ -103,47 +103,6 @@ class TemplateRegressionTests(SimpleTestCase): output1 = template.render(Context({'foo': range(3), 'get_value': lambda: next(gen1)})) self.assertEqual(output1, '[0,1,2,3]', 'Expected [0,1,2,3] in first template, got {}'.format(output1)) - def test_cache_regression_20130(self): - t = Template('{% load cache %}{% cache 1 regression_20130 %}foo{% endcache %}') - cachenode = t.nodelist[1] - self.assertEqual(cachenode.fragment_name, 'regression_20130') - - @override_settings(CACHES={ - 'default': { - 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', - 'LOCATION': 'default', - }, - 'template_fragments': { - 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', - 'LOCATION': 'fragments', - }, - }) - def test_cache_fragment_cache(self): - """ - When a cache called "template_fragments" is present, the cache tag - will use it in preference to 'default' - """ - t1 = Template('{% load cache %}{% cache 1 fragment %}foo{% endcache %}') - t2 = Template('{% load cache %}{% cache 1 fragment using="default" %}bar{% endcache %}') - - ctx = Context() - o1 = t1.render(ctx) - o2 = t2.render(ctx) - - self.assertEqual(o1, 'foo') - self.assertEqual(o2, 'bar') - - def test_cache_missing_backend(self): - """ - When a cache that doesn't exist is specified, the cache tag will - raise a TemplateSyntaxError - '""" - t = Template('{% load cache %}{% cache 1 backend using="unknown" %}bar{% endcache %}') - - ctx = Context() - with self.assertRaises(TemplateSyntaxError): - t.render(ctx) - def test_ifchanged_render_once(self): """ Test for ticket #19890. The content of ifchanged template tag was rendered twice.""" |
