Skip to content

Commit

Permalink
Update tests to cover the test case that this PR fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rudd-O authored Sep 7, 2022
1 parent 653bb70 commit b1ff114
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/plone/base/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ def physicalPathFromURL(self, url):
ctx.vh_root = "/approot/PloneSite/folder/SubSite"
self.assertEqual(get_top_site_from_url(ctx, req).id, "SubSite")

# Case 6 (VHM points to child of subsite, this bug existed 4 years):
req = MockRequest()
req.vh_root = "/approot/PloneSite/folder/SubSite/en"
ctx = MockContext("/approot/PloneSite/folder/SubSite/en/archives")
ctx.vh_root = "/approot/PloneSite/folder/SubSite/en"
self.assertEqual(get_top_site_from_url(ctx, req).id, "en")

def test_human_readable_size_int(self):
from plone.base.utils import human_readable_size

Expand Down

0 comments on commit b1ff114

Please sign in to comment.