Created
March 7, 2015 21:46
-
-
Save miroli/9f2b4d06a9704c8fb77e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import unittest | |
from pycar_advanced import utils | |
class UtilsTestCase(unittest.TestCase): | |
def test_slugify(self): | |
"""Test utils.slugify""" | |
# It should: | |
# | |
# * Remove punctuation | |
# * Lowercase characters | |
# * Convert whitespace to a dash "-" | |
self.assertEqual(utils.slugify("Cool string!"), "cool-string") | |
def test_slugify_whitespace(self): | |
# TODO: slugify should also: | |
# | |
# * Remove leading/trailing whitespace | |
# * Compact consecutive whitespace | |
self.assertEqual(utils.slugify(" Hey man"), "hey-man") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment