Skip to content
Myr

look for json module in the right place. all tests

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

now pass with the new module layout

authored by Justin Quick · committed by Justin Quick · parent c4f64c1 · Browse files · 1 file+3 added−3 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+3 added−3 removed

  • tests:+3 added−3 removed

1 file+3 added−3 removed

modified:tests/flask_tests.py+3 added-3 removed
19 unmodified lines
20from contextlib import contextmanager21from datetime import datetime22from werkzeug import parse_date, parse_options_header23from cStringIO import StringIO24from flask.helpers import json252526example_path = os.path.join(os.path.dirname(__file__), '..', 'examples')27sys.path.append(os.path.join(example_path, 'flaskr'))28sys.path.append(os.path.join(example_path, 'minitwit'))29
378 unmodified lines
408 c = app.test_client()409 for url in '/kw', '/dict':410 rv = c.get(url)411 assert rv.mimetype == 'application/json'412 assert flask.json.loads(rv.data) == d412 assert json.loads(rv.data) == d413414 def test_json_attr(self):415 app = flask.Flask(__name__)416 @app.route('/add', methods=['POST'])417 def add():418 return unicode(flask.request.json['a'] + flask.request.json['b'])419 c = app.test_client()420 rv = c.post('/add', data=flask.json.dumps({'a': 1, 'b': 2}),420 rv = c.post('/add', data=json.dumps({'a': 1, 'b': 2}),421 content_type='application/json')422 assert rv.data == '3'423424 def test_template_escaping(self):
466 unmodified lines