Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove pytz version constraint #227

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ include = [

[tool.poetry.dependencies]
python = "^3.7"
pytz = "^2022.7"
pytz = "*"
Flask = "^2.0.0"
Babel = "^2.11.0"
Jinja2 = "^3.1.2"
Expand Down
16 changes: 8 additions & 8 deletions tests/test_date_formatting.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ def test_basics():
delta = timedelta(days=6)

with app.test_request_context():
assert babel.format_datetime(d) == 'Apr 12, 2010, 1:46:00 PM'
assert babel.format_datetime(d) == 'Apr 12, 2010, 1:46:00PM'
assert babel.format_date(d) == 'Apr 12, 2010'
assert babel.format_time(d) == '1:46:00 PM'
assert babel.format_time(d) == '1:46:00PM'
assert babel.format_timedelta(delta) == '1 week'
assert babel.format_timedelta(delta, threshold=1) == '6 days'

with app.test_request_context():
get_babel(app).default_timezone = 'Europe/Vienna'
assert babel.format_datetime(d) == 'Apr 12, 2010, 3:46:00 PM'
assert babel.format_datetime(d) == 'Apr 12, 2010, 3:46:00PM'
assert babel.format_date(d) == 'Apr 12, 2010'
assert babel.format_time(d) == '3:46:00 PM'
assert babel.format_time(d) == '3:46:00PM'

with app.test_request_context():
get_babel(app).default_locale = 'de_DE'
assert babel.format_datetime(d, 'long') == \
'12. April 2010 um 15:46:00 MESZ'
'12. April 2010, 15:46:00 MESZ'


def test_custom_formats():
Expand Down Expand Up @@ -64,7 +64,7 @@ def select_timezone():
get_babel(app).timezone_selector = select_timezone

with app.test_request_context():
assert babel.format_datetime(d) == 'Apr 12, 2010, 1:46:00 PM'
assert babel.format_datetime(d) == 'Apr 12, 2010, 1:46:00PM'

the_locale = 'de_DE'
the_timezone = 'Europe/Vienna'
Expand All @@ -78,7 +78,7 @@ def test_refreshing():
babel.Babel(app)
d = datetime(2010, 4, 12, 13, 46)
with app.test_request_context():
assert babel.format_datetime(d) == 'Apr 12, 2010, 1:46:00 PM'
assert babel.format_datetime(d) == 'Apr 12, 2010, 1:46:00PM'
get_babel(app).default_timezone = 'Europe/Vienna'
babel.refresh()
assert babel.format_datetime(d) == 'Apr 12, 2010, 3:46:00 PM'
assert babel.format_datetime(d) == 'Apr 12, 2010, 3:46:00PM'