mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Removed ssi/url tags from future per deprecation timeline; refs #21939.
This commit is contained in:
		| @@ -2,29 +2,11 @@ import warnings | |||||||
|  |  | ||||||
| from django.template import Library | from django.template import Library | ||||||
| from django.template import defaulttags | from django.template import defaulttags | ||||||
| from django.utils.deprecation import RemovedInDjango19Warning, RemovedInDjango20Warning | from django.utils.deprecation import RemovedInDjango20Warning | ||||||
|  |  | ||||||
| register = Library() | register = Library() | ||||||
|  |  | ||||||
|  |  | ||||||
| @register.tag |  | ||||||
| def ssi(parser, token): |  | ||||||
|     warnings.warn( |  | ||||||
|         "Loading the `ssi` tag from the `future` library is deprecated and " |  | ||||||
|         "will be removed in Django 1.9. Use the default `ssi` tag instead.", |  | ||||||
|         RemovedInDjango19Warning) |  | ||||||
|     return defaulttags.ssi(parser, token) |  | ||||||
|  |  | ||||||
|  |  | ||||||
| @register.tag |  | ||||||
| def url(parser, token): |  | ||||||
|     warnings.warn( |  | ||||||
|         "Loading the `url` tag from the `future` library is deprecated and " |  | ||||||
|         "will be removed in Django 1.9. Use the default `url` tag instead.", |  | ||||||
|         RemovedInDjango19Warning) |  | ||||||
|     return defaulttags.url(parser, token) |  | ||||||
|  |  | ||||||
|  |  | ||||||
| @register.tag | @register.tag | ||||||
| def cycle(parser, token): | def cycle(parser, token): | ||||||
|     """ |     """ | ||||||
|   | |||||||
| @@ -1,7 +1,7 @@ | |||||||
| import os | import os | ||||||
|  |  | ||||||
| from django.test import ignore_warnings, SimpleTestCase | from django.test import ignore_warnings, SimpleTestCase | ||||||
| from django.utils.deprecation import RemovedInDjango19Warning, RemovedInDjango20Warning | from django.utils.deprecation import RemovedInDjango20Warning | ||||||
|  |  | ||||||
| from ..utils import ROOT, setup | from ..utils import ROOT, setup | ||||||
|  |  | ||||||
| @@ -32,16 +32,14 @@ class SsiTagTests(SimpleTestCase): | |||||||
|         self.assertEqual(output, ''), |         self.assertEqual(output, ''), | ||||||
|  |  | ||||||
|     # Test passing as a variable |     # Test passing as a variable | ||||||
|     @ignore_warnings(category=RemovedInDjango19Warning) |     @setup({'ssi04': '{% ssi ssi_file %}'}) | ||||||
|     @setup({'ssi04': '{% load ssi from future %}{% ssi ssi_file %}'}) |  | ||||||
|     def test_ssi04(self): |     def test_ssi04(self): | ||||||
|         output = self.engine.render_to_string('ssi04', { |         output = self.engine.render_to_string('ssi04', { | ||||||
|             'ssi_file': os.path.join(ROOT, 'templates', 'ssi_include.html') |             'ssi_file': os.path.join(ROOT, 'templates', 'ssi_include.html') | ||||||
|         }) |         }) | ||||||
|         self.assertEqual(output, 'This is for testing an ssi include. {{ test }}\n') |         self.assertEqual(output, 'This is for testing an ssi include. {{ test }}\n') | ||||||
|  |  | ||||||
|     @ignore_warnings(category=RemovedInDjango19Warning) |     @setup({'ssi05': '{% ssi ssi_file %}'}) | ||||||
|     @setup({'ssi05': '{% load ssi from future %}{% ssi ssi_file %}'}) |  | ||||||
|     def test_ssi05(self): |     def test_ssi05(self): | ||||||
|         output = self.engine.render_to_string('ssi05', {'ssi_file': 'no_file'}) |         output = self.engine.render_to_string('ssi05', {'ssi_file': 'no_file'}) | ||||||
|         self.assertEqual(output, '') |         self.assertEqual(output, '') | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user