def test_spanish_filter(self): """ Test usage of the blacklist with spanish via the templatetag. """ before = "<h1>Me encanta guiones</h1>" after = softhyphen(before, language='es-es') self.failUnlessEqual(after, "<h1>Me en­can­ta gu­io­nes</h1>")
def test_simple_filter(self): """ Test simple usage of the hyphenation method via the templatetag. """ before = "<h1>I love hyphenation</h1>" after = softhyphen(before) self.failUnlessEqual(after, "<h1>I love hy­phen­a­tion</h1>")
def test_russian_filter(self): """ Test usage of the templatetag with Russian. Also tests that the tag works properly with non-ascii characters. """ before = u'<h1>\u043f\u0435\u0440\u0435.</h1>' after = softhyphen(before, language='ru-ru') self.failUnlessEqual(after, u'<h1>\u043f\u0435­\u0440\u0435.</h1>')
def test_russian_filter(self): """ Test usage of the templatetag with Russian. Also tests that the tag works properly with non-ascii characters. """ before = u'<h1>\u042f \u043b\u044e\u0431\u043b\u044e \u043f\u0435\u0440\u0435\u043d\u043e\u0441\u044b.</h1>' after = softhyphen(before, language='ru-ru') self.failUnlessEqual(after, u'<h1>\u042f \u043b\u044e­\u0431\u043b\u044e \u043f\u0435­\u0440\u0435­\u043d\u043e­\u0441\u044b.</h1>')