diff --git a/wagtail/admin/tests/test_privacy.py b/wagtail/admin/tests/test_privacy.py index e6bb5b63e52b..ac697e19a712 100644 --- a/wagtail/admin/tests/test_privacy.py +++ b/wagtail/admin/tests/test_privacy.py @@ -364,11 +364,14 @@ def test_explorer_private(self): # Check the response self.assertEqual(response.status_code, 200) - # Check the privacy indicator is private - self.assertContains(response, '
') - self.assertContains( - response, '
' - ) + # Check the private privacy indicator is visible + private_indicator = response.select_one("[data-privacy-sidebar-private]") + # There should not be any classes applied + self.assertEqual(private_indicator["class"], []) + + # Privacy indicator should be hidden + public_indicator = response.select_one("[data-privacy-sidebar-public].w-hidden") + self.assertIsNotNone(public_indicator) def test_explorer_private_child(self): """