def METHOD_NAME(self, role, expected_urlname, privilege=None):
    if role is not None:
        role = getattr(self, role)
    user = self._make_web_user('elodin@theuniversity.com', role=role)
    self.addCleanup(user.delete, self.domain, deleted_by=None)
    self.client.login(username=user.username, password=self.global_password)
    context = privilege_enabled(privilege) if privilege else nullcontext()
    with context:
        url = reverse("domain_homepage", args=[self.domain])
        response = self.client.get(url, follow=True)
    self.assertEqual(response.status_code, 200)
    self.assertEqual(reverse(expected_urlname, args=[self.domain]),
                     response.request['PATH_INFO'])