Skip to content

Commit 2a73bbc

Browse files
committed
Added testcase. This fixes pallets#108
1 parent 6fca662 commit 2a73bbc

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

tests/flask_tests.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,15 @@ def test_index():
11021102
rv = c.get('/', 'http://test.localhost/')
11031103
assert rv.data == 'test index'
11041104

1105+
def test_module_static_path_subdomain(self):
1106+
app = flask.Flask(__name__)
1107+
app.config['SERVER_NAME'] = 'example.com'
1108+
from subdomaintestmodule import mod
1109+
app.register_module(mod)
1110+
c = app.test_client()
1111+
rv = c.get('/static/hello.txt', 'http://foo.example.com/')
1112+
assert rv.data.strip() == 'Hello Subdomain'
1113+
11051114
def test_subdomain_matching(self):
11061115
app = flask.Flask(__name__)
11071116
app.config['SERVER_NAME'] = 'localhost'

tests/subdomaintestmodule/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from flask import Module
2+
3+
4+
mod = Module(__name__, 'foo', subdomain='foo')
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Hello Subdomain

0 commit comments

Comments
 (0)