Skip to content

Commit

Permalink
Revert "fix: datetime serialisation (#2314)"
Browse files Browse the repository at this point in the history
This reverts commit c4ffd45.
  • Loading branch information
mxschmitt committed Mar 5, 2024
1 parent 2ab641a commit 665af8d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion playwright/_impl/_js_handle.py
Expand Up @@ -129,7 +129,7 @@ def serialize_value(
if math.isnan(value):
return dict(v="NaN")
if isinstance(value, datetime):
return dict(d=value.isoformat())
return dict(d=value.isoformat() + "Z")
if isinstance(value, bool):
return {"b": value}
if isinstance(value, (int, float)):
Expand Down
8 changes: 2 additions & 6 deletions tests/sync/test_assertions.py
Expand Up @@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import datetime
import re
from datetime import datetime

import pytest

Expand Down Expand Up @@ -163,11 +163,7 @@ def test_assertions_locator_to_have_js_property(page: Page, server: Server) -> N
)
expect(page.locator("div")).to_have_js_property(
"foo",
{
"a": 1,
"b": "string",
"c": datetime.datetime.fromtimestamp(1627503992000 / 1000),
},
{"a": 1, "b": "string", "c": datetime.utcfromtimestamp(1627503992000 / 1000)},
)


Expand Down

0 comments on commit 665af8d

Please sign in to comment.