def test_json(self): """ :return: """ data = {'a': 1, 'b': 'hello', 'c': True, 'd': date(2016, 9, 9)} result = render.json(hello=data) self.assertGreater(len(result), 1)
def json(**kwargs): """ Adds the specified data to the the output display window with the specified key. This allows the user to make available arbitrary JSON-compatible data to the display for runtime use. :param kwargs: Each keyword argument is added to the CD.data object with the specified key and value. """ r = _get_report() r.append_body(render.json(**kwargs))
def json(**kwargs): """ Adds the specified data to the the output display window with the specified key. This allows the user to make available arbitrary JSON-compatible data to the display for runtime use. :param kwargs: Each keyword argument is added to the CD.data object with the specified key and value. """ r = _get_report() r.append_body(render.json(**kwargs)) r.stdout_interceptor.write_source('{}\n'.format( _json_io.dumps(kwargs, indent=2)))
def json(**kwargs): """ Adds the specified data to the the output display window with the specified key. This allows the user to make available arbitrary JSON-compatible data to the display for runtime use. :param kwargs: Each keyword argument is added to the CD.data object with the specified key and value. """ r = _get_report() r.append_body(render.json(**kwargs)) r.stdout_interceptor.write_source( '{}\n'.format(_json_io.dumps(kwargs, indent=2)) )
def test_json(self): """Should inject JSON into body""" data = {'a': 1, 'b': 'hello', 'c': True, 'd': date(2016, 9, 9)} result = render.json(hello=data) self.assertGreater(len(result), 1)