Skip to content

Commit

Permalink
Fix: enrollment expiry session (#1987)
Browse files Browse the repository at this point in the history
  • Loading branch information
thekaveman authored Mar 26, 2024
2 parents 3b6c386 + 73957a4 commit e728782
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions benefits/core/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def reset(request):
request.session[_AGENCY] = None
request.session[_ELIGIBILITY] = None
request.session[_ORIGIN] = reverse("core:index")
request.session[_ENROLLMENT_EXP] = None
request.session[_ENROLLMENT_TOKEN] = None
request.session[_ENROLLMENT_TOKEN_EXP] = None
request.session[_OAUTH_TOKEN] = None
Expand Down
1 change: 1 addition & 0 deletions benefits/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def RUNTIME_ENVIRONMENT():
"benefits.core.context_processors.active_agencies",
"benefits.core.context_processors.analytics",
"benefits.core.context_processors.authentication",
"benefits.core.context_processors.enrollment",
"benefits.core.context_processors.origin",
]

Expand Down
3 changes: 3 additions & 0 deletions tests/pytest/core/test_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,14 @@ def test_reset_eligibility(app_request):

@pytest.mark.django_db
def test_reset_enrollment(app_request):
app_request.session[session._ENROLLMENT_EXP] = "1234567890"
app_request.session[session._ENROLLMENT_TOKEN] = "enrollmenttoken123"
app_request.session[session._ENROLLMENT_TOKEN_EXP] = "1234567890"

session.reset(app_request)

assert session.enrollment_expiry(app_request) is None
assert session.enrollment_reenrollment(app_request) is None
assert session.enrollment_token(app_request) is None
assert session.enrollment_token_expiry(app_request) is None
assert not session.enrollment_token_valid(app_request)
Expand Down

0 comments on commit e728782

Please sign in to comment.