forked from orbit-oss/flask
Make sure that there is a test for subdomain matching with ports
This commit is contained in:
parent
67101c8b93
commit
367b254c78
1 changed files with 11 additions and 0 deletions
|
|
@ -961,6 +961,17 @@ class SubdomainTestCase(FlaskTestCase):
|
||||||
rv = c.get('/', 'http://mitsuhiko.localhost/')
|
rv = c.get('/', 'http://mitsuhiko.localhost/')
|
||||||
self.assert_equal(rv.data, 'index for mitsuhiko')
|
self.assert_equal(rv.data, 'index for mitsuhiko')
|
||||||
|
|
||||||
|
def test_subdomain_matching_with_ports(self):
|
||||||
|
app = flask.Flask(__name__)
|
||||||
|
app.config['SERVER_NAME'] = 'localhost:3000'
|
||||||
|
@app.route('/', subdomain='<user>')
|
||||||
|
def index(user):
|
||||||
|
return 'index for %s' % user
|
||||||
|
|
||||||
|
c = app.test_client()
|
||||||
|
rv = c.get('/', 'http://mitsuhiko.localhost:3000/')
|
||||||
|
self.assert_equal(rv.data, 'index for mitsuhiko')
|
||||||
|
|
||||||
@emits_module_deprecation_warning
|
@emits_module_deprecation_warning
|
||||||
def test_module_subdomain_support(self):
|
def test_module_subdomain_support(self):
|
||||||
app = flask.Flask(__name__)
|
app = flask.Flask(__name__)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue