diff options
| author | Tim Graham <timograham@gmail.com> | 2014-07-12 09:50:27 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-07-14 08:45:19 -0400 |
| commit | 38e001ab6caa8e5da68dbefd17322adcd2603c21 (patch) | |
| tree | 6512aacff04c7593ec699dd570940eb0eba4eae6 /tests | |
| parent | 7affb4ad58e7ee93e4cca0c350315c63035ed648 (diff) | |
Fixed #22789 -- Deprecated django.contrib.webdesign.
Moved the {% lorem %} tag to built-in tags.
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/runtests.py | 6 | ||||
| -rw-r--r-- | tests/template_tests/tests.py | 2 | ||||
| -rw-r--r-- | tests/utils_tests/test_lorem_ipsum.py | 16 |
3 files changed, 24 insertions, 0 deletions
diff --git a/tests/runtests.py b/tests/runtests.py index e0d5a173f2..aa8313036c 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -135,6 +135,12 @@ def setup(verbosity, test_labels): handler = logging.StreamHandler() logger.addHandler(handler) + warnings.filterwarnings( + 'ignore', + 'django.contrib.webdesign will be removed in Django 2.0.', + RemovedInDjango20Warning + ) + # Load all the ALWAYS_INSTALLED_APPS. django.setup() diff --git a/tests/template_tests/tests.py b/tests/template_tests/tests.py index 4ec6815710..e785962c21 100644 --- a/tests/template_tests/tests.py +++ b/tests/template_tests/tests.py @@ -1351,6 +1351,8 @@ class TemplateTests(TestCase): 'load11': ("{% load subpackage.echo_invalid %}", {}, template.TemplateSyntaxError), 'load12': ("{% load subpackage.missing %}", {}, template.TemplateSyntaxError), + 'lorem1': ("{% lorem 3 w %}", {}, "lorem ipsum dolor"), + ### I18N ################################################################## # {% spaceless %} tag diff --git a/tests/utils_tests/test_lorem_ipsum.py b/tests/utils_tests/test_lorem_ipsum.py new file mode 100644 index 0000000000..9d0a2d6b2a --- /dev/null +++ b/tests/utils_tests/test_lorem_ipsum.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +import unittest + +from django.utils.lorem_ipsum import paragraphs, words + + +class WebdesignTest(unittest.TestCase): + + def test_words(self): + self.assertEqual(words(7), 'lorem ipsum dolor sit amet consectetur adipisicing') + + def test_paragraphs(self): + self.assertEqual(paragraphs(1), + ['Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.']) |
