mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
Fixed absolute URLs (now for real)
This commit is contained in:
0
src/tests/helpers/__init__.py
Normal file
0
src/tests/helpers/__init__.py
Normal file
14
src/tests/helpers/test_urls.py
Normal file
14
src/tests/helpers/test_urls.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from django.conf import settings
|
||||
from pretix.helpers.urls import build_absolute_uri
|
||||
from django.core import urlresolvers
|
||||
|
||||
|
||||
def test_site_url_domain():
|
||||
settings.SITE_URL = 'https://example.com'
|
||||
assert build_absolute_uri('control:auth.login') == 'https://example.com/control/login'
|
||||
|
||||
|
||||
def test_site_url_subpath():
|
||||
settings.SITE_URL = 'https://example.com/presale'
|
||||
urlresolvers.set_script_prefix('/presale/')
|
||||
assert build_absolute_uri('control:auth.login') == 'https://example.com/presale/control/login'
|
||||
Reference in New Issue
Block a user