示例#1
0
    def test_slugify(self):
        """ Test the ``slugify`` method. """

        # Cloned from Django tests suite
        output = slugify(' Jack & Jill like numbers 1,2,3 and 4 and silly characters ?%.$!/')
        self.assertEqual('jack-jill-like-numbers-123-and-4-and-silly-characters', output)

        output = slugify("Un \xe9l\xe9phant \xe0 l'or\xe9e du bois")
        self.assertEqual('un-elephant-a-loree-du-bois', output)
示例#2
0
    def test_slugify(self):
        """ Test the ``slugify`` method. """

        # Cloned from Django tests suite
        output = slugify(
            ' Jack & Jill like numbers 1,2,3 and 4 and silly characters ?%.$!/'
        )
        self.assertEqual(
            'jack-jill-like-numbers-123-and-4-and-silly-characters', output)

        output = slugify("Un \xe9l\xe9phant \xe0 l'or\xe9e du bois")
        self.assertEqual('un-elephant-a-loree-du-bois', output)
示例#3
0
 def test_slugify_no_value_trailing_whitespaces(self):
     """ Test the ``slugify`` method without value. """
     output = slugify('      ')
     self.assertEqual('', output)
示例#4
0
 def test_slugify_no_value(self):
     """ Test the ``slugify`` method without value. """
     output = slugify('')
     self.assertEqual('', output)
示例#5
0
 def test_slugify_no_value_trailing_whitespaces(self):
     """ Test the ``slugify`` method without value. """
     output = slugify('      ')
     self.assertEqual('', output)
示例#6
0
 def test_slugify_no_value(self):
     """ Test the ``slugify`` method without value. """
     output = slugify('')
     self.assertEqual('', output)