1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

Fixed #14516 -- Extract methods from removetags and slugify template filters

Patch by @jphalip updated to apply, documentation and release notes
added.

I've documented strip_tags as well as remove_tags as the difference
between the two wouldn't be immediately obvious.
This commit is contained in:
Marc Tamlyn
2012-08-18 13:53:22 +01:00
committed by Andrew Godwin
parent 58683e9c82
commit 212b9826bd
7 changed files with 94 additions and 5 deletions

View File

@@ -113,3 +113,11 @@ class TestUtilsText(SimpleTestCase):
self.assertEqual(text.wrap(long_word, 20), long_word)
self.assertEqual(text.wrap('a %s word' % long_word, 10),
'a\n%s\nword' % long_word)
def test_slugify(self):
items = (
(u'Hello, World!', 'hello-world'),
(u'spam & eggs', 'spam-eggs'),
)
for value, output in items:
self.assertEqual(text.slugify(value), output)