mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-53502: Fixes for tests in gh-113363 (#113627)
* gh-53502: Fixes for tests in gh-113363 * Use 32-bit compatible date in test_dump_naive_datetime_with_aware_datetime_option * Saving non-aware datetimes will use the old behaviour regardless of the aware_datimetime setting
This commit is contained in:
parent
b4b2cc1012
commit
8e4ff5c788
2 changed files with 4 additions and 5 deletions
|
@ -881,12 +881,11 @@ class TestPlistlib(unittest.TestCase):
|
|||
# Save a naive datetime with aware_datetime set to true. This will lead
|
||||
# to having different time as compared to the current machine's
|
||||
# timezone, which is UTC.
|
||||
dt = datetime.datetime(2345, 6, 7, 8, tzinfo=None)
|
||||
dt = datetime.datetime(2003, 6, 7, 8, tzinfo=None)
|
||||
for fmt in ALL_FORMATS:
|
||||
s = plistlib.dumps(dt, fmt=fmt, aware_datetime=True)
|
||||
parsed = plistlib.loads(s, aware_datetime=False)
|
||||
expected = dt + datetime.timedelta(seconds=time.timezone)
|
||||
self.assertEqual(parsed, expected)
|
||||
self.assertEqual(parsed, dt)
|
||||
|
||||
|
||||
class TestBinaryPlistlib(unittest.TestCase):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue