forked from orbit-oss/flask
Fix some literals
This commit is contained in:
parent
3f51a09db4
commit
05f66ad735
9 changed files with 125 additions and 126 deletions
|
|
@ -20,8 +20,8 @@ class ViewTestCase(FlaskTestCase):
|
|||
def common_test(self, app):
|
||||
c = app.test_client()
|
||||
|
||||
self.assert_equal(c.get('/').data, 'GET')
|
||||
self.assert_equal(c.post('/').data, 'POST')
|
||||
self.assert_equal(c.get('/').data, b'GET')
|
||||
self.assert_equal(c.post('/').data, b'POST')
|
||||
self.assert_equal(c.put('/').status_code, 405)
|
||||
meths = parse_set_header(c.open('/', method='OPTIONS').headers['Allow'])
|
||||
self.assert_equal(sorted(meths), ['GET', 'HEAD', 'OPTIONS', 'POST'])
|
||||
|
|
@ -108,7 +108,7 @@ class ViewTestCase(FlaskTestCase):
|
|||
c = app.test_client()
|
||||
rv = c.get('/')
|
||||
self.assert_equal(rv.headers['X-Parachute'], 'awesome')
|
||||
self.assert_equal(rv.data, 'Awesome')
|
||||
self.assert_equal(rv.data, b'Awesome')
|
||||
|
||||
def test_implicit_head(self):
|
||||
app = flask.Flask(__name__)
|
||||
|
|
@ -122,10 +122,10 @@ class ViewTestCase(FlaskTestCase):
|
|||
app.add_url_rule('/', view_func=Index.as_view('index'))
|
||||
c = app.test_client()
|
||||
rv = c.get('/')
|
||||
self.assert_equal(rv.data, 'Blub')
|
||||
self.assert_equal(rv.data, b'Blub')
|
||||
self.assert_equal(rv.headers['X-Method'], 'GET')
|
||||
rv = c.head('/')
|
||||
self.assert_equal(rv.data, '')
|
||||
self.assert_equal(rv.data, b'')
|
||||
self.assert_equal(rv.headers['X-Method'], 'HEAD')
|
||||
|
||||
def test_explicit_head(self):
|
||||
|
|
@ -140,9 +140,9 @@ class ViewTestCase(FlaskTestCase):
|
|||
app.add_url_rule('/', view_func=Index.as_view('index'))
|
||||
c = app.test_client()
|
||||
rv = c.get('/')
|
||||
self.assert_equal(rv.data, 'GET')
|
||||
self.assert_equal(rv.data, b'GET')
|
||||
rv = c.head('/')
|
||||
self.assert_equal(rv.data, '')
|
||||
self.assert_equal(rv.data, b'')
|
||||
self.assert_equal(rv.headers['X-Method'], 'HEAD')
|
||||
|
||||
def test_endpoint_override(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue