code: def test_tojson_filter(app, req_ctx):
      # The tojson filter is tested in Jinja, this confirms that it's
      # using Flask's dumps.
      rv = flask.render_template_string(
          "const data = {{ data|tojson }};",
          data={
              "name": "</script>",
              "time": datetime.datetime(2021, 2, 1, 7, 15),
          },
      )
      assert rv == (
          'const data = {"name": "\\u003c/script\\u003e",'
          ' "time": "Mon, 01 Feb 2021 07:15:00 GMT"};'
      )
  
imports: import datetime
  import decimal
  import io
  import uuid
  import pytest
  from werkzeug.http import http_date
  import flask
  from flask import json
  from flask.json.provider import DefaultJSONProvider
label_desc: Use image node_id 14 for calling a global function with example usage: test_tojson_filter(app, req_ctx) without return types