forked from orbit-oss/flask
Added a testcase where SERVER_NAME and APPLICATION_ROOT are not set
This commit is contained in:
parent
e853a0f739
commit
8dbd71ef8e
1 changed files with 13 additions and 0 deletions
|
|
@ -1057,6 +1057,19 @@ class TestToolsTestCase(FlaskTestCase):
|
|||
rv = c.get('/')
|
||||
self.assertEqual(rv.data, 'http://example.com:1234/foo/')
|
||||
|
||||
def test_environ_defaults(self):
|
||||
app = flask.Flask(__name__)
|
||||
app.testing = True
|
||||
@app.route('/')
|
||||
def index():
|
||||
return flask.request.url
|
||||
|
||||
ctx = app.test_request_context()
|
||||
self.assertEqual(ctx.request.url, 'http://localhost/')
|
||||
with app.test_client() as c:
|
||||
rv = c.get('/')
|
||||
self.assertEqual(rv.data, 'http://localhost/')
|
||||
|
||||
def test_session_transactions(self):
|
||||
app = flask.Flask(__name__)
|
||||
app.testing = True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue