Skip to content
Myr

test json.dumps for object with __html__ method

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by David Lord · parent a0e2aca · Browse files · 1 file+10 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+10 added−0 removed

  • tests:+10 added−0 removed

1 file+10 added−0 removed

modified:tests/test_json.py+10 added
4 unmodified lines
5import pytest6from werkzeug.http import http_date78import flask9from flask import json101112@pytest.mark.parametrize("debug", (True, False))13def test_bad_request_debug_message(app, client, debug):
386 unmodified lines
400 try:401 assert lines == sorted_by_int402 except AssertionError:403 assert lines == sorted_by_str404405406def test_html_method():407 class ObjectWithHTML:408 def __html__(self):409 return "<p>test</p>"410411 result = json.dumps(ObjectWithHTML())412 assert result == '"<p>test</p>"'