From b3a5c661e179fbddb2081346aff7a77169df7676 Mon Sep 17 00:00:00 2001 From: Hassan Abouelela Date: Sun, 17 Oct 2021 18:46:53 +0400 Subject: Fixes Test Paths For Windows (#596) Fixes a test that fails on Windows due to differing path separators. This is currently the only failing test. Signed-off-by: Hassan Abouelela --- pydis_site/apps/content/tests/test_views.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'pydis_site/apps/content/tests') diff --git a/pydis_site/apps/content/tests/test_views.py b/pydis_site/apps/content/tests/test_views.py index b6e752d6..eadad7e3 100644 --- a/pydis_site/apps/content/tests/test_views.py +++ b/pydis_site/apps/content/tests/test_views.py @@ -167,11 +167,16 @@ class PageOrCategoryViewTests(MockPagesTestCase, SimpleTestCase, TestCase): self.ViewClass.dispatch(request, location="category/subcategory/with_metadata") context = self.ViewClass.get_context_data() + + # Convert to paths to avoid dealing with non-standard path separators + for item in context["breadcrumb_items"]: + item["path"] = Path(item["path"]) + self.assertEquals( context["breadcrumb_items"], [ - {"name": PARSED_CATEGORY_INFO["title"], "path": "."}, - {"name": PARSED_CATEGORY_INFO["title"], "path": "category"}, - {"name": PARSED_CATEGORY_INFO["title"], "path": "category/subcategory"}, + {"name": PARSED_CATEGORY_INFO["title"], "path": Path(".")}, + {"name": PARSED_CATEGORY_INFO["title"], "path": Path("category")}, + {"name": PARSED_CATEGORY_INFO["title"], "path": Path("category/subcategory")}, ] ) -- cgit v1.2.3