Support for Django up to 2.2.
[fnpdjango.git] / tests / tests / test_templatetags_fnp_annoy.py
diff --git a/tests/tests/test_templatetags_fnp_annoy.py b/tests/tests/test_templatetags_fnp_annoy.py
new file mode 100644 (file)
index 0000000..8ed80b1
--- /dev/null
@@ -0,0 +1,22 @@
+# -*- 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
+
+from django.test import TestCase
+from django.test.utils import override_settings
+
+
+class TemplatetagsFNPAnnoyTestCase(TestCase):
+
+    def test_annoy(self):
+        from fnpdjango.templatetags import fnp_annoy
+        self.assertEqual(
+            fnp_annoy.annoy(),
+            '')
+        with override_settings(FNP_ANNOY=True):
+            self.assertTrue(
+                'https://nowoczesnapolska.org.pl/pomoz-nam/1-procent/'
+                in fnp_annoy.annoy()
+            )