Ejemplo n.º 1
0
 def test_slugify(self):
     items = (
         ('Hello, World!', 'hello-world'),
         ('spam & eggs', 'spam-eggs'),
     )
     for value, output in items:
         self.assertEqual(text.slugify(value), output)
Ejemplo n.º 2
0
def slugify(value):
    """
    Converts to lowercase, removes non-word characters (alphanumerics and
    underscores) and converts spaces to hyphens. Also strips leading and
    trailing whitespace.
    """
    from djangocg.utils.text import slugify
    return slugify(value)