Skip to content

Commit 07a1952

Browse files
committed
Added testcase. This fixes pallets#108
1 parent fdae354 commit 07a1952

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
@@ -1049,6 +1049,15 @@ def test_index():
10491049
rv = c.get('/', 'http://test.localhost/')
10501050
assert rv.data == 'test index'
10511051

1052+
def test_module_static_path_subdomain(self):
1053+
app = flask.Flask(__name__)
1054+
app.config['SERVER_NAME'] = 'example.com'
1055+
from subdomaintestmodule import mod
1056+
app.register_module(mod)
1057+
c = app.test_client()
1058+
rv = c.get('/static/hello.txt', 'http://foo.example.com/')
1059+
assert rv.data.strip() == 'Hello Subdomain'
1060+
10521061
def test_subdomain_matching(self):
10531062
app = flask.Flask(__name__)
10541063
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)