예제 #1
0
 def test_simple(self):
    ''' make sure we go lowercase and handle leading/trailing 
       whitespace correctly.
    '''
    self.assertEqual("simple", post.slugify(u"Simple"))
    self.assertEqual("simple", post.slugify(" Simple"))
    self.assertEqual("simple", post.slugify("Simple "))
    self.assertEqual("simple", post.slugify(" Simple "))
예제 #2
0
 def test_unicode(self):
    ''' Unicode converted to acceptable IRI format? '''
    self.assertEqual("m%C3%BCller", post.slugify(u"M\u00fcller"))
예제 #3
0
 def test_punctuation(self):
    ''' punctuation removed, replaced with a single dash like space? '''
    self.assertEqual("remove-the-punctuation", 
       post.slugify("Remove, the? !punctuation..."))
    self.assertEqual("this-that-and-something-else", 
       post.slugify(" This, that, and something else? "))
예제 #4
0
 def test_dashes(self):
    ''' spaces replaced with a single dash? '''
    self.assertEqual("simple-test", post.slugify("SIMPLE TEST"))
    self.assertEqual("simple-test", post.slugify("SIMPLE   TEST"))