X-Git-Url: https://git.mdrn.pl/fnpdjango.git/blobdiff_plain/4bc4a4cd7c8470de220e86fe44b50d427368c942..c5f50329c7ddea87333c6137d994252c47783aa4:/tests/tests/test_templatetags_fnp_markup.py diff --git a/tests/tests/test_templatetags_fnp_markup.py b/tests/tests/test_templatetags_fnp_markup.py new file mode 100644 index 0000000..5c8e07c --- /dev/null +++ b/tests/tests/test_templatetags_fnp_markup.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# This file is part of FNPDjango, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See README.md for more information. +# +from __future__ import unicode_literals + +import sys +from django.test import TestCase + +try: + from unittest import skipIf +except ImportError: + # Don't need skipping for Python2.6. + skipIf = lambda expr, comment: lambda test: test + + +@skipIf(sys.version_info[:2] == (3, 2), + "No usable python-textile for Python 3.2.") +class TemplatetagsFNPMarkupTestCase(TestCase): + + def test_textile_en(self): + from fnpdjango.templatetags import fnp_markup + self.assertEqual( + fnp_markup.textile_en('Test "Textile".'), + '\t

Test “Textile”.

') + self.assertEqual( + fnp_markup.textile_restricted_en('Test "Textile".'), + '\t

Test “Textile”.

') + + def test_textile_pl(self): + from fnpdjango.templatetags import fnp_markup + self.assertEqual( + fnp_markup.textile_pl('Test "Textile".'), + '\t

Test „Textile”.

') + self.assertEqual( + fnp_markup.textile_restricted_pl('Test "Textile".'), + '\t

Test „Textile”.

')