Skip to content

Commit

Permalink
Add tests for en languages
Browse files Browse the repository at this point in the history
  • Loading branch information
2br-2b authored Dec 14, 2024
1 parent 5a02c59 commit b15582a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ def test_i18n() -> None:
assert humanize.ordinal(5) == "5th"
assert humanize.precisedelta(one_min_three_seconds) == "1 minute and 7 seconds"

def test_en_locale() -> None:
three_seconds = NOW - dt.timedelta(seconds=3)

humanize.i18n.activate(None)
test_str = humanize.naturaltime(three_seconds)

humanize.i18n.activate("en_US")
assert test_str = humanize.naturaltime(three_seconds)

humanize.i18n.activate("en_GB")
assert test_str = humanize.naturaltime(three_seconds)

humanize.i18n.deactivate()

def test_intcomma() -> None:
number = 10_000_000
Expand Down

0 comments on commit b15582a

Please sign in to comment.