diff options
author | 2021-04-02 17:47:42 +0800 | |
---|---|---|
committer | 2021-04-02 17:47:42 +0800 | |
commit | bb8a57a00835ffae8382f4360e0f55888bbe03b0 (patch) | |
tree | ba1817a540189d098ce856aa876167640a714b13 /pydis_site/apps/content/tests | |
parent | Fix overriden PAGES_PATH in settings.py. (diff) |
Use metadata titles in Sub-Articles dropdown.
This allows us to keep filenames (thus URLs) as concise as possible,
while having a more descriptive entry in the Sub-Articles dropdown for
category pages.
Diffstat (limited to 'pydis_site/apps/content/tests')
-rw-r--r-- | pydis_site/apps/content/tests/helpers.py | 2 | ||||
-rw-r--r-- | pydis_site/apps/content/tests/test_templatetags.py | 12 | ||||
-rw-r--r-- | pydis_site/apps/content/tests/test_views.py | 2 |
3 files changed, 2 insertions, 14 deletions
diff --git a/pydis_site/apps/content/tests/helpers.py b/pydis_site/apps/content/tests/helpers.py index 202dee42..29140375 100644 --- a/pydis_site/apps/content/tests/helpers.py +++ b/pydis_site/apps/content/tests/helpers.py @@ -87,5 +87,5 @@ class MockPagesTestCase(TestCase): # See: https://jmcgeheeiv.github.io/pyfakefs/release/usage.html#os-temporary-directories self.fs.create_file("tmp/_info.yml", contents=CATEGORY_INFO) self.fs.create_file("tmp.md", contents=MARKDOWN_WITH_METADATA) - self.fs.create_file("tmp/category/_info.yml", contents=MARKDOWN_WITH_METADATA) + self.fs.create_file("tmp/category/_info.yml", contents=CATEGORY_INFO) self.fs.create_dir("tmp/category/subcategory_without_info") diff --git a/pydis_site/apps/content/tests/test_templatetags.py b/pydis_site/apps/content/tests/test_templatetags.py deleted file mode 100644 index 1147bd88..00000000 --- a/pydis_site/apps/content/tests/test_templatetags.py +++ /dev/null @@ -1,12 +0,0 @@ -from django.test import TestCase - -from pydis_site.apps.content.templatetags.str_methods import replace_hyphens - - -class TestTemplateTags(TestCase): - """Tests for the custom template tags in the content app.""" - - def test_replace_hyphens(self): - self.assertEquals(replace_hyphens("word-with-hyphens", " "), "word with hyphens") - self.assertEquals(replace_hyphens("---", ""), "") - self.assertEquals(replace_hyphens("hi----", "A"), "hiAAAA") diff --git a/pydis_site/apps/content/tests/test_views.py b/pydis_site/apps/content/tests/test_views.py index 36d771a1..74d38f78 100644 --- a/pydis_site/apps/content/tests/test_views.py +++ b/pydis_site/apps/content/tests/test_views.py @@ -161,7 +161,7 @@ class PageOrCategoryViewTests(MockPagesTestCase, SimpleTestCase, TestCase): "page_title": PARSED_METADATA["title"], "page_description": PARSED_METADATA["description"], "relevant_links": PARSED_METADATA["relevant_links"], - "subarticles": ["category"] + "subarticles": [{"path": "category", "name": "Category Name"}] } for key, expected_value in expected_page_context.items(): with self.subTest(): |