mirror of
https://github.com/django-components/django-components.git
synced 2025-08-31 11:17:21 +00:00
refactor: Fix path resolution relative to COMPONENTS.dirs + add CI test to ensure sampleproject works (#1075)
* refactor: Fix path resolution relative to COMPONENTS.dirs + add CI test to ensure sampleproject works * refactor: fix compat with Windows by explicitly using utf8 encoding to read component files * refactor: add missing components to tests * docs: update changelog * refactor: fix formatting
This commit is contained in:
parent
f07818fc7d
commit
9f68f0f1a1
6 changed files with 100 additions and 14 deletions
|
@ -414,6 +414,30 @@ class TestComponentMedia:
|
|||
assertInHTML('<script src="glob/glob_1.js"></script>', rendered)
|
||||
assertInHTML('<script src="glob/glob_2.js"></script>', rendered)
|
||||
|
||||
@djc_test(
|
||||
django_settings={
|
||||
"INSTALLED_APPS": ("django_components", "tests"),
|
||||
}
|
||||
)
|
||||
def test_non_globs_not_modified(self):
|
||||
from tests.components.glob.glob import NonGlobComponentRootDir
|
||||
rendered = NonGlobComponentRootDir.render()
|
||||
|
||||
assertInHTML('<link href="glob/glob_1.css" media="all" rel="stylesheet">', rendered)
|
||||
assertInHTML('<script src="glob/glob_1.js"></script>', rendered)
|
||||
|
||||
@djc_test(
|
||||
django_settings={
|
||||
"INSTALLED_APPS": ("django_components", "tests"),
|
||||
}
|
||||
)
|
||||
def test_non_globs_not_modified_nonexist(self):
|
||||
from tests.components.glob.glob import NonGlobNonexistComponentRootDir
|
||||
rendered = NonGlobNonexistComponentRootDir.render()
|
||||
|
||||
assertInHTML('<link href="glob/glob_nonexist.css" media="all" rel="stylesheet">', rendered)
|
||||
assertInHTML('<script src="glob/glob_nonexist.js"></script>', rendered)
|
||||
|
||||
def test_glob_pattern_does_not_break_urls(self):
|
||||
from tests.components.glob.glob import UrlComponent
|
||||
rendered = UrlComponent.render()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue