Skip to content

Commit

Permalink
Update DATETIME_FORMAT to clarify it must be UTC (#1163)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikonst committed Feb 28, 2023
1 parent 9903c69 commit b5600ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pynamodb/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@

# Defaults
DEFAULT_ENCODING = 'utf-8'
DATETIME_FORMAT = '%Y-%m-%dT%H:%M:%S.%f%z'
DATETIME_FORMAT = '%Y-%m-%dT%H:%M:%S.%f+0000'
SERVICE_NAME = 'dynamodb'
HTTP_OK = 200
HTTP_BAD_REQUEST = 400
Expand Down
2 changes: 1 addition & 1 deletion tests/test_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def test_utc_date_time_deserialize_pre_1000_not_padded(self):
]
)
def test_utc_date_time_invalid(self, invalid_string):
with pytest.raises(ValueError, match="does not match format"):
with pytest.raises(ValueError, match=r"does not match format '%Y-%m-%dT%H:%M:%S.%f\+0000'"):
self.attr.deserialize(invalid_string)


Expand Down

0 comments on commit b5600ea

Please sign in to comment.