Test if aware datetime.datetime objects are converted into GMT.
(tz)
| 165 | |
| 166 | @pytest.mark.parametrize("tz", (("UTC", 0), ("PST", -8), ("KST", 9))) |
| 167 | def test_jsonify_aware_datetimes(tz): |
| 168 | """Test if aware datetime.datetime objects are converted into GMT.""" |
| 169 | tzinfo = FixedOffset(hours=tz[1], name=tz[0]) |
| 170 | dt = datetime.datetime(2017, 1, 1, 12, 34, 56, tzinfo=tzinfo) |
| 171 | gmt = FixedOffset(hours=0, name="GMT") |
| 172 | expected = dt.astimezone(gmt).strftime('"%a, %d %b %Y %H:%M:%S %Z"') |
| 173 | assert flask.json.dumps(dt) == expected |
| 174 | |
| 175 | |
| 176 | def test_jsonify_uuid_types(app, client): |
nothing calls this directly
no test coverage detected