Skip to content

Commit

Permalink
test: verifing test cases 22
Browse files Browse the repository at this point in the history
  • Loading branch information
mfarhan943 committed Sep 23, 2024
1 parent 241f820 commit 505e56c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions common/djangoapps/track/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from datetime import date, datetime
from zoneinfo import ZoneInfo


class DateTimeJSONEncoder(json.JSONEncoder):
"""JSON encoder aware of datetime.datetime and datetime.date objects"""

Expand Down
2 changes: 1 addition & 1 deletion xmodule/tests/test_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def test_non_std_from_json(self):
Test the non-standard args being passed to from_json
"""
now = datetime.datetime.now(ZoneInfo("UTC"))
delta = now - datetime.datetime.fromtimestamp(0, UTC)
delta = now - datetime.datetime.fromtimestamp(0, ZoneInfo("UTC"))
assert DateTest.date.from_json(delta.total_seconds() * 1000) == now
yesterday = datetime.datetime.now(ZoneInfo("UTC")) - datetime.timedelta(days=-1)
assert DateTest.date.from_json(yesterday) == yesterday
Expand Down

0 comments on commit 505e56c

Please sign in to comment.