Files
pretix_original/src/tests/helpers/test_urls.py
Raphael Michel afd766999c Upgrade to Django 2.1 (#710)
* Upgrade to Django 2.0

* more models

* i18n foo

* Update setup.py

* Fix Sentry exception PRETIXEU-JC

* Enforce slug uniqueness

* Import sorting

* Upgrade to Django 2.1

* Travis config

* Try to fix PostgreSQL failure

* Smaller test matrix

* staticfiles→static

* Include request in all authenticate() calls
2018-08-06 12:48:46 +02:00

18 lines
581 B
Python

from django import urls
from django.conf import settings
from pretix.helpers.urls import build_absolute_uri
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'
old_prefix = urls.get_script_prefix()
urls.set_script_prefix('/presale/')
assert build_absolute_uri('control:auth.login') == 'https://example.com/presale/control/login'
urls.set_script_prefix(old_prefix)