Skip to content

Commit b3a5c66

Browse files
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 <[email protected]>
1 parent d113808 commit b3a5c66

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

pydis_site/apps/content/tests/test_views.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,16 @@ def test_get_context_data_breadcrumbs(self):
167167
self.ViewClass.dispatch(request, location="category/subcategory/with_metadata")
168168

169169
context = self.ViewClass.get_context_data()
170+
171+
# Convert to paths to avoid dealing with non-standard path separators
172+
for item in context["breadcrumb_items"]:
173+
item["path"] = Path(item["path"])
174+
170175
self.assertEquals(
171176
context["breadcrumb_items"],
172177
[
173-
{"name": PARSED_CATEGORY_INFO["title"], "path": "."},
174-
{"name": PARSED_CATEGORY_INFO["title"], "path": "category"},
175-
{"name": PARSED_CATEGORY_INFO["title"], "path": "category/subcategory"},
178+
{"name": PARSED_CATEGORY_INFO["title"], "path": Path(".")},
179+
{"name": PARSED_CATEGORY_INFO["title"], "path": Path("category")},
180+
{"name": PARSED_CATEGORY_INFO["title"], "path": Path("category/subcategory")},
176181
]
177182
)

0 commit comments

Comments
 (0)