diff options
| -rw-r--r-- | pydis_site/apps/home/tests/test_wiki_templatetags.py | 24 | ||||
| -rw-r--r-- | pydis_site/settings.py | 1 | 
2 files changed, 17 insertions, 8 deletions
| diff --git a/pydis_site/apps/home/tests/test_wiki_templatetags.py b/pydis_site/apps/home/tests/test_wiki_templatetags.py index af85339f..5cd673bf 100644 --- a/pydis_site/apps/home/tests/test_wiki_templatetags.py +++ b/pydis_site/apps/home/tests/test_wiki_templatetags.py @@ -1,7 +1,7 @@  from unittest.mock import Mock  from django.test import TestCase -from django.template import Template +from django.template import Template, Context  from wiki.models import URLPath as _URLPath @@ -17,23 +17,31 @@ class TestURLPathFilter(TestCase):      )      def test_str(self): -        context = {"obj": "path"} -        rendered = self.TEMPLATE.render(context) +        context = {"obj": "/path/"} +        rendered = self.TEMPLATE.render(Context(context)) + +        self.assertEqual(rendered.strip(), "/path/")      def test_str_empty(self):          context = {"obj": ""} -        rendered = self.TEMPLATE.render(context) +        rendered = self.TEMPLATE.render(Context(context)) + +        self.assertEqual(rendered.strip(), "/")      def test_urlpath(self):          url_path = URLPath() -        url_path.path = None +        url_path.path = "/path/"          context = {"obj": url_path} -        rendered = self.TEMPLATE.render(context) +        rendered = self.TEMPLATE.render(Context(context)) + +        self.assertEqual(rendered.strip(), "/path/")      def test_urlpath_root(self):          url_path = URLPath() -        url_path.path = "/path/" +        url_path.path = None          context = {"obj": url_path} -        rendered = self.TEMPLATE.render(context) +        rendered = self.TEMPLATE.render(Context(context)) + +        self.assertEqual(rendered.strip(), "/") diff --git a/pydis_site/settings.py b/pydis_site/settings.py index 0bd4957b..4ffb06a1 100644 --- a/pydis_site/settings.py +++ b/pydis_site/settings.py @@ -93,6 +93,7 @@ INSTALLED_APPS = [      'wiki.plugins.images.apps.ImagesConfig',      'wiki.plugins.links.apps.LinksConfig',      'wiki.plugins.redlinks.apps.RedlinksConfig', +    'wiki.plugins.notifications.apps.NotificationsConfig',  # Required for migrations  ]  MIDDLEWARE = [ | 
