def test_raise_for_dashboard_access_as_unauthorized_guest(self): g.user = self.unauthorized_guest with self.assertRaises(DashboardAccessDeniedError): security_manager.raise_for_dashboard_access(self.dash)
def get_by_id_or_slug(id_or_slug: str) -> Dashboard: dashboard = Dashboard.get(id_or_slug) if not dashboard: raise DashboardNotFoundError() security_manager.raise_for_dashboard_access(dashboard) return dashboard
def test_raise_for_dashboard_access_as_guest(self): g.user = self.authorized_guest security_manager.raise_for_dashboard_access(self.dash)