1
0
Fork 0
forked from github/pelican
pelican-theme/pelican/tests
Vladimír Vondruš 0b13aa9b46 Make URL part joining aware of absolute URLs.
Previously, with RELATIVE_URLS disabled, when both SITEURL and
STATIC_URL were absolute, the final generate data URLs looked wrong like
this (two absolute URLs joined by `/`):

    http://your.site/http://static.your.site/image.png

With this patch, the data URLs are correctly:

    http://static.your.site/image.png

This also applies to all *_URL configuration options (for example,
ability to have pages and articles on different domains) and behaves
like one expects even with URLs starting with just `//`, thanks to
making use of urllib.parse.urljoin().

However, when RELATIVE_URLS are enabled, urllib.parse.urljoin() doesn't
handle the relative base correctly. In that case, simple os.path.join()
is used. That, however, breaks the above case, but as RELATIVE_URLS are
meant for local development (thus no data scattered across multiple
domains), I don't see any problem.

Just to clarify, this is a fully backwards-compatible change, it only
enables new use cases that were impossible before.
2017-10-26 23:23:51 +02:00
..
content Fix extension-matching bug in generators.py 2016-10-12 23:33:29 -07:00
mixed_content Make StaticGenerator skip content sources. Refs #1019. 2014-10-31 16:46:01 -07:00
nested_content/maindir Make PAGE_EXCLUDES work with subdirs. Fixes #1500. 2014-11-01 17:38:20 -07:00
output Regenerate tests' output 2017-08-06 13:55:34 +02:00
TestPages Generate {tag}-style links on pages correctly. Fixes #1513 2015-01-02 01:20:57 -07:00
__init__.py Add logging for warnings during test suite run 2015-10-22 09:45:04 +02:00
default_conf.py fulfil pep8 standard 2015-08-17 13:34:32 +02:00
support.py PyCodeStyle fixes to keep Flake8 happy 2017-10-26 13:53:32 -07:00
test_cache.py Add tests to make sure cached content is properly added to generators 2016-12-10 05:18:35 -05:00
test_contents.py Make URL part joining aware of absolute URLs. 2017-10-26 23:23:51 +02:00
test_generators.py Add two STATIC_ settings. Fix #1982 2016-12-30 02:45:37 -05:00
test_importer.py fulfil pep8 standard 2015-08-17 13:34:32 +02:00
test_paginator.py fulfil pep8 standard 2015-08-17 13:34:32 +02:00
test_pelican.py Updates test cases to use MARKDOWN 2016-11-02 21:11:42 +01:00
test_readers.py Fix more python 3.6 regex DeprecationWarning's 2017-03-29 10:19:47 +02:00
test_rstdirectives.py fulfil pep8 standard 2015-08-17 13:34:32 +02:00
test_settings.py fulfil pep8 standard 2015-08-17 13:34:32 +02:00
test_testsuite.py Drop unsupported Python 3.3 2017-10-02 18:33:21 +03:00
test_urlwrappers.py Add AUTHOR_SUBSTITUTIONS 2016-04-01 23:01:57 +03:00
test_utils.py Check safety of save_as earlier if possible 2017-02-27 21:49:17 +01:00