forked from orbit-oss/flask
Added testcase. This fixes #108
This commit is contained in:
parent
6fca662c84
commit
2a73bbc436
3 changed files with 14 additions and 0 deletions
|
|
@ -1102,6 +1102,15 @@ class SubdomainTestCase(unittest.TestCase):
|
||||||
rv = c.get('/', 'http://test.localhost/')
|
rv = c.get('/', 'http://test.localhost/')
|
||||||
assert rv.data == 'test index'
|
assert rv.data == 'test index'
|
||||||
|
|
||||||
|
def test_module_static_path_subdomain(self):
|
||||||
|
app = flask.Flask(__name__)
|
||||||
|
app.config['SERVER_NAME'] = 'example.com'
|
||||||
|
from subdomaintestmodule import mod
|
||||||
|
app.register_module(mod)
|
||||||
|
c = app.test_client()
|
||||||
|
rv = c.get('/static/hello.txt', 'http://foo.example.com/')
|
||||||
|
assert rv.data.strip() == 'Hello Subdomain'
|
||||||
|
|
||||||
def test_subdomain_matching(self):
|
def test_subdomain_matching(self):
|
||||||
app = flask.Flask(__name__)
|
app = flask.Flask(__name__)
|
||||||
app.config['SERVER_NAME'] = 'localhost'
|
app.config['SERVER_NAME'] = 'localhost'
|
||||||
|
|
|
||||||
4
tests/subdomaintestmodule/__init__.py
Normal file
4
tests/subdomaintestmodule/__init__.py
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
from flask import Module
|
||||||
|
|
||||||
|
|
||||||
|
mod = Module(__name__, 'foo', subdomain='foo')
|
||||||
1
tests/subdomaintestmodule/static/hello.txt
Normal file
1
tests/subdomaintestmodule/static/hello.txt
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Hello Subdomain
|
||||||
Loading…
Add table
Add a link
Reference in a new issue