Coverage for benefits/metro_mobility_wallet/urls.py: 100%
12 statements
« prev ^ index » next coverage.py v7.16.2, created at 2026-10-08 19:50 +0000
« prev ^ index » next coverage.py v7.16.2, created at 2026-10-08 19:50 +0000
1"""
2The metro_mobility_wallet application: URLConf for the metro_mobility_wallet app.
3"""
5from cdt_identity import views as cdt_identity_views
6from cdt_identity.routes import Routes as OAuthRoutes
7from django.urls import include, path
8from django.utils.decorators import decorator_from_middleware
10from benefits.oauth.middleware import FlowUsesClaimsVerificationSessionRequired
11from benefits.routes import routes
13from . import oauth, views
15decorator = decorator_from_middleware(FlowUsesClaimsVerificationSessionRequired)
16kwargs = {"hooks": oauth.OAuthHooks}
18app_name = "metro_mobility_wallet"
20oauth_patterns = [
21 path(OAuthRoutes.login, decorator(cdt_identity_views.login), kwargs, name=OAuthRoutes.login),
22 path(OAuthRoutes.authorize, decorator(cdt_identity_views.authorize), kwargs, name=OAuthRoutes.authorize),
23 path(OAuthRoutes.cancel, decorator(cdt_identity_views.cancel), kwargs, name=OAuthRoutes.cancel),
24 path(
25 OAuthRoutes.failure_to_proof, decorator(cdt_identity_views.failure_to_proof), kwargs, name=OAuthRoutes.failure_to_proof
26 ),
27 path(OAuthRoutes.logout, decorator(cdt_identity_views.logout), kwargs, name=OAuthRoutes.logout),
28 path(OAuthRoutes.post_logout, decorator(cdt_identity_views.post_logout), kwargs, name=OAuthRoutes.post_logout),
29 path("error", views.SystemErrorView.as_view(), name=routes.name(routes.OAUTH_SYSTEM_ERROR)),
30]
32urlpatterns = [
33 # /metro-mobility-wallet/
34 path("", views.IndexView.as_view(), name="index"),
35 #
36 # This results in OAuth URLs in the form `metro-mobility-wallet/oauth/*` with names of `metro_mobility_wallet:cdt:*`
37 path("oauth/", include((oauth_patterns, "cdt"), namespace="cdt")),
38]