Fixed absolute URLs (now for real)

This commit is contained in:
Raphael Michel
2015-06-21 21:15:12 +02:00
parent 058d33765c
commit fa94d17d74
3 changed files with 15 additions and 3 deletions

View File

View 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'