-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: CalFresh enrollment success with expiration (#1988)
- Loading branch information
Showing
13 changed files
with
68 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# https://docs.djangoproject.com/en/5.0/ref/templates/builtins/#date-and-time-formatting-specifiers | ||
DATE_FORMAT = "F j, Y" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Both “d” and “e” are backslash-escaped, because otherwise each is a format string | ||
# that displays the day and the timezone name, respectively. | ||
# Instead we want the literal word "de" | ||
# https://docs.djangoproject.com/en/5.0/ref/templates/builtins/#date-and-time-formatting-specifiers | ||
DATE_FORMAT = r"j \d\e F \d\e Y" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from datetime import datetime | ||
|
||
import pytest | ||
|
||
from django.utils.formats import date_format | ||
|
||
from benefits.locale.en.formats import DATE_FORMAT as DATE_FORMAT_EN | ||
from benefits.locale.es.formats import DATE_FORMAT as DATE_FORMAT_ES | ||
|
||
|
||
@pytest.fixture | ||
def date_december(): | ||
return datetime(2024, 12, 1) | ||
|
||
|
||
@pytest.fixture | ||
def date_march(): | ||
return datetime(2024, 3, 1) | ||
|
||
|
||
def test_en_DATE_FORMAT_december(date_december): | ||
assert date_format(date_december, DATE_FORMAT_EN) == "December 1, 2024" | ||
|
||
|
||
def test_en_DATE_FORMAT_march(date_march): | ||
assert date_format(date_march, DATE_FORMAT_EN) == "March 1, 2024" | ||
|
||
|
||
def test_es_DATE_FORMAT_december(settings, date_december): | ||
settings.LANGUAGE_CODE = "es" | ||
assert date_format(date_december, DATE_FORMAT_ES) == "1 de diciembre de 2024" | ||
|
||
|
||
def test_es_DATE_FORMAT_march(settings, date_march): | ||
settings.LANGUAGE_CODE = "es" | ||
assert date_format(date_march, DATE_FORMAT_ES) == "1 de marzo de 2024" |