Beispiel #1
0
 def test_translit_no_double_dash(self):
     title = "double  space  here"
     #
     result = publish.translit(title)
     #
     self.assertEqual(result, "double-space-here")
Beispiel #2
0
 def test_translit_not_ends_with_dash(self):
     title = "many spaces      "
     #
     result = publish.translit(title)
     #
     self.assertEqual(result, "many-spaces")
Beispiel #3
0
 def test_translit_preserves_numbers(self):
     title = "title 1"
     #
     result = publish.translit(title)
     #
     self.assertEqual(result, "title-1")
Beispiel #4
0
 def test_translit_removes_non_alnum(self):
     title = "hey! is it title?"
     #
     result = publish.translit(title)
     #
     self.assertEqual(result, "hey-is-it-title")
Beispiel #5
0
 def test_tranlit_space_to_dash(self):
     title = "title title title"
     #
     result = publish.translit(title)
     #
     self.assertEqual(result, "title-title-title")
Beispiel #6
0
 def test_translit_rus_to_eng(self):
     title = "строка"
     #
     result = publish.translit(title)
     #
     self.assertEqual(result, "stroka")
Beispiel #7
0
 def test_translit_uppercase_lowered(self):
     title = "TITLE"
     #
     result = publish.translit(title)
     #
     self.assertEqual(result, "title")