aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_slugify.py
diff options
context:
space:
mode:
authorLibravatarDererk <dererk@satellogic.com>2016-11-15 14:18:53 -0300
committerLibravatarDererk <dererk@satellogic.com>2016-11-15 14:18:53 -0300
commit1ad5102b7ddd181bb9c632b124d3ea4c7db28be6 (patch)
tree73dda18465d0f4b8eb52d4482282a387c9f67c95 /tests/test_slugify.py
parentb67294f76809a681ff73f209ed691a3e3f00563d (diff)
parentffb671c61a24a9086343b54bad080e145ff33fc5 (diff)
Merge tag 'upstream/7.8.1'
Upstream version 7.8.1 # gpg: Firmado el mar 15 nov 2016 14:18:48 ART # gpg: usando RSA clave A6C7B88B9583046A11C5403E0B00FB6CEBE2D002 # gpg: Firma correcta de "Ulises Vitulli <dererk@debian.org>" [absoluta] # gpg: alias "Dererk <dererk@torproject.org>" [absoluta] # gpg: alias "Ulises Vitulli <uvitulli@fi.uba.ar>" [absoluta] # gpg: alias "Ulises Vitulli <dererk@satellogic.com>" [absoluta]
Diffstat (limited to 'tests/test_slugify.py')
-rw-r--r--tests/test_slugify.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/tests/test_slugify.py b/tests/test_slugify.py
index 9dec5a6..c910aaa 100644
--- a/tests/test_slugify.py
+++ b/tests/test_slugify.py
@@ -8,41 +8,41 @@ import nikola.utils
def test_ascii():
"""Test an ASCII-only string."""
- o = nikola.utils.slugify(u'hello')
+ o = nikola.utils.slugify(u'hello', lang='en')
assert o == u'hello'
assert isinstance(o, nikola.utils.unicode_str)
def test_ascii_dash():
"""Test an ASCII string, with dashes."""
- o = nikola.utils.slugify(u'hello-world')
+ o = nikola.utils.slugify(u'hello-world', lang='en')
assert o == u'hello-world'
assert isinstance(o, nikola.utils.unicode_str)
def test_ascii_fancy():
"""Test an ASCII string, with fancy characters."""
- o = nikola.utils.slugify(u'The quick brown fox jumps over the lazy dog!-123.456')
+ o = nikola.utils.slugify(u'The quick brown fox jumps over the lazy dog!-123.456', lang='en')
assert o == u'the-quick-brown-fox-jumps-over-the-lazy-dog-123456'
assert isinstance(o, nikola.utils.unicode_str)
def test_pl():
"""Test a string with Polish diacritical characters."""
- o = nikola.utils.slugify(u'zażółćgęśląjaźń')
+ o = nikola.utils.slugify(u'zażółćgęśląjaźń', lang='pl')
assert o == u'zazolcgeslajazn'
assert isinstance(o, nikola.utils.unicode_str)
def test_pl_dash():
"""Test a string with Polish diacritical characters and dashes."""
- o = nikola.utils.slugify(u'zażółć-gęślą-jaźń')
+ o = nikola.utils.slugify(u'zażółć-gęślą-jaźń', lang='pl')
assert o == u'zazolc-gesla-jazn'
def test_pl_fancy():
"""Test a string with Polish diacritical characters and fancy characters."""
- o = nikola.utils.slugify(u'Zażółć gęślą jaźń!-123.456')
+ o = nikola.utils.slugify(u'Zażółć gęślą jaźń!-123.456', lang='pl')
assert o == u'zazolc-gesla-jazn-123456'
assert isinstance(o, nikola.utils.unicode_str)
@@ -50,7 +50,7 @@ def test_pl_fancy():
def test_disarmed():
"""Test disarmed slugify."""
nikola.utils.USE_SLUGIFY = False
- o = nikola.utils.slugify(u'Zażółć gęślą jaźń!-123.456')
+ o = nikola.utils.slugify(u'Zażółć gęślą jaźń!-123.456', lang='pl')
assert o == u'Zażółć gęślą jaźń!-123.456'
assert isinstance(o, nikola.utils.unicode_str)
nikola.utils.USE_SLUGIFY = True
@@ -59,7 +59,7 @@ def test_disarmed():
def test_disarmed_weird():
"""Test disarmed slugify with banned characters."""
nikola.utils.USE_SLUGIFY = False
- o = nikola.utils.slugify(u'Zażółć gęślą jaźń!-123.456 "Hello World"?#H<e>l/l\\o:W\'o\rr*l\td|!\n')
+ o = nikola.utils.slugify(u'Zażółć gęślą jaźń!-123.456 "Hello World"?#H<e>l/l\\o:W\'o\rr*l\td|!\n', lang='pl')
assert o == u'Zażółć gęślą jaźń!-123.456 -Hello World---H-e-l-l-o-W-o-r-l-d-!-'
assert isinstance(o, nikola.utils.unicode_str)
nikola.utils.USE_SLUGIFY = True