|
|
@ -78,7 +78,7 @@ class BasicFunctionalityTestCase(FlaskTestCase): |
|
|
|
self.assert_equal(sorted(rv.allow), ['GET', 'HEAD', 'OPTIONS']) |
|
|
|
self.assert_equal(sorted(rv.allow), ['GET', 'HEAD', 'OPTIONS']) |
|
|
|
rv = c.head('/') |
|
|
|
rv = c.head('/') |
|
|
|
self.assert_equal(rv.status_code, 200) |
|
|
|
self.assert_equal(rv.status_code, 200) |
|
|
|
self.assert_true(not rv.data) # head truncates |
|
|
|
self.assert_false(rv.data) # head truncates |
|
|
|
self.assert_equal(c.post('/more').data, b'POST') |
|
|
|
self.assert_equal(c.post('/more').data, b'POST') |
|
|
|
self.assert_equal(c.get('/more').data, b'GET') |
|
|
|
self.assert_equal(c.get('/more').data, b'GET') |
|
|
|
rv = c.delete('/more') |
|
|
|
rv = c.delete('/more') |
|
|
@ -102,7 +102,7 @@ class BasicFunctionalityTestCase(FlaskTestCase): |
|
|
|
self.assert_equal(sorted(rv.allow), ['GET', 'HEAD', 'OPTIONS']) |
|
|
|
self.assert_equal(sorted(rv.allow), ['GET', 'HEAD', 'OPTIONS']) |
|
|
|
rv = c.head('/') |
|
|
|
rv = c.head('/') |
|
|
|
self.assert_equal(rv.status_code, 200) |
|
|
|
self.assert_equal(rv.status_code, 200) |
|
|
|
self.assert_true(not rv.data) # head truncates |
|
|
|
self.assert_false(rv.data) # head truncates |
|
|
|
self.assert_equal(c.post('/more').data, b'POST') |
|
|
|
self.assert_equal(c.post('/more').data, b'POST') |
|
|
|
self.assert_equal(c.get('/more').data, b'GET') |
|
|
|
self.assert_equal(c.get('/more').data, b'GET') |
|
|
|
rv = c.delete('/more') |
|
|
|
rv = c.delete('/more') |
|
|
@ -347,7 +347,7 @@ class BasicFunctionalityTestCase(FlaskTestCase): |
|
|
|
app.secret_key = 'testkey' |
|
|
|
app.secret_key = 'testkey' |
|
|
|
|
|
|
|
|
|
|
|
with app.test_request_context(): |
|
|
|
with app.test_request_context(): |
|
|
|
self.assert_true(not flask.session.modified) |
|
|
|
self.assert_false(flask.session.modified) |
|
|
|
flask.flash('Zap') |
|
|
|
flask.flash('Zap') |
|
|
|
flask.session.modified = False |
|
|
|
flask.session.modified = False |
|
|
|
flask.flash('Zip') |
|
|
|
flask.flash('Zip') |
|
|
@ -967,7 +967,7 @@ class BasicFunctionalityTestCase(FlaskTestCase): |
|
|
|
@app.route('/') |
|
|
|
@app.route('/') |
|
|
|
def index(): |
|
|
|
def index(): |
|
|
|
return 'Awesome' |
|
|
|
return 'Awesome' |
|
|
|
self.assert_true(not app.got_first_request) |
|
|
|
self.assert_false(app.got_first_request) |
|
|
|
self.assert_equal(app.test_client().get('/').data, b'Awesome') |
|
|
|
self.assert_equal(app.test_client().get('/').data, b'Awesome') |
|
|
|
try: |
|
|
|
try: |
|
|
|
@app.route('/foo') |
|
|
|
@app.route('/foo') |
|
|
|