Added FUNKWHALE_HOSTNAME and FEDERATION_HOSTNAME settings

This commit is contained in:
Eliot Berriot 2018-03-29 00:00:01 +02:00
parent 588da6ff33
commit 90c1d02919
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
3 changed files with 36 additions and 1 deletions

View file

@ -0,0 +1,14 @@
import pytest
from funkwhale_api.federation import utils
@pytest.mark.parametrize('url,path,expected', [
('http://test.com', '/hello', 'http://test.com/hello'),
('http://test.com/', 'hello', 'http://test.com/hello'),
('http://test.com/', '/hello', 'http://test.com/hello'),
('http://test.com', 'hello', 'http://test.com/hello'),
])
def test_full_url(settings, url, path, expected):
settings.FUNKWHALE_URL = url
assert utils.full_url(path) == expected