From 665666d6f4213da8db57ebb480947b7caf1fe382 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 17 Dec 2023 15:36:26 +0100 Subject: Merging upstream version 3.0.0. Signed-off-by: Daniel Baumann --- tests/formatting/test_formatter.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'tests/formatting/test_formatter.py') diff --git a/tests/formatting/test_formatter.py b/tests/formatting/test_formatter.py index 76c7a7f..4c4b008 100644 --- a/tests/formatting/test_formatter.py +++ b/tests/formatting/test_formatter.py @@ -113,6 +113,20 @@ def test_day_of_week(): assert f.format(d, "do") == "0th" +def test_localized_day_of_week(): + f = Formatter() + d = pendulum.datetime(2016, 8, 28) + assert f.format(d, "e") == "0" + assert f.format(d, "e", locale="en-gb") == "6" + assert f.format(d.add(days=2), "e") == "2" + assert f.format(d.add(days=2), "e", locale="en-gb") == "1" + + assert f.format(d, "eo") == "1st" + assert f.format(d, "eo", locale="en-gb") == "7th" + assert f.format(d.add(days=2), "eo") == "3rd" + assert f.format(d.add(days=2), "eo", locale="en-gb") == "2nd" + + def test_day_of_iso_week(): f = Formatter() d = pendulum.datetime(2016, 8, 28) -- cgit v1.2.3