Skip to content

Commit 665af8d

Browse files
committed
Revert "fix: datetime serialisation (#2314)"
This reverts commit c4ffd45.
1 parent 2ab641a commit 665af8d

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

playwright/_impl/_js_handle.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def serialize_value(
129129
if math.isnan(value):
130130
return dict(v="NaN")
131131
if isinstance(value, datetime):
132-
return dict(d=value.isoformat())
132+
return dict(d=value.isoformat() + "Z")
133133
if isinstance(value, bool):
134134
return {"b": value}
135135
if isinstance(value, (int, float)):

tests/sync/test_assertions.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import datetime
1615
import re
16+
from datetime import datetime
1717

1818
import pytest
1919

@@ -163,11 +163,7 @@ def test_assertions_locator_to_have_js_property(page: Page, server: Server) -> N
163163
)
164164
expect(page.locator("div")).to_have_js_property(
165165
"foo",
166-
{
167-
"a": 1,
168-
"b": "string",
169-
"c": datetime.datetime.fromtimestamp(1627503992000 / 1000),
170-
},
166+
{"a": 1, "b": "string", "c": datetime.utcfromtimestamp(1627503992000 / 1000)},
171167
)
172168

173169

0 commit comments

Comments
 (0)