def test_valid_url(mocker):
    public_admin = PublicAdminSite("dashboard", PUBLIC_APPS)
    valid, invalid = mocker.MagicMock(), mocker.MagicMock()
    valid.pattern.regex.pattern = "/my_open_house/"
    invalid.pattern.regex.pattern = "/my_open_house/add/"
    assert public_admin.valid_url(valid)
    assert not public_admin.valid_url(invalid)
예제 #2
0
 def get_urls(self):
     """Filter out the URLs that should not exist in a public admin."""
     return [
         url for url in super().get_urls() if PublicAdminSite.valid_url(url)
     ]
예제 #3
0
 def get_urls(self):
     return [
         url for url in super().get_urls() if PublicAdminSite.valid_url(url)
     ]