mirror of
https://github.com/django-components/django-components.git
synced 2025-08-04 14:28:18 +00:00
Resolve media and template files relative to component class dir (#395), thanks @JuroOravec
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Emil Stenström <emil@emilstenstrom.se>
This commit is contained in:
parent
1de859bd34
commit
37fd901908
21 changed files with 477 additions and 43 deletions
|
@ -246,9 +246,13 @@ class ContextCalledOnceTests(SimpleTestCase):
|
|||
"{% load component_tags %}{% component_dependencies %}"
|
||||
"{% component name='incrementer' %}{% endcomponent %}"
|
||||
)
|
||||
rendered = template.render(Context()).strip()
|
||||
|
||||
self.assertEqual(rendered, '<p class="incrementer">value=1;calls=1</p>', rendered)
|
||||
rendered = template.render(Context()).strip().replace("\n", "")
|
||||
self.assertHTMLEqual(
|
||||
rendered,
|
||||
'<link href="relative_file/relative_file.css" media="all" rel="stylesheet">'
|
||||
'<script src="relative_file/relative_file.js"></script>'
|
||||
'<p class="incrementer">value=1;calls=1</p>',
|
||||
)
|
||||
|
||||
def test_one_context_call_with_simple_component_and_arg(self):
|
||||
template = Template("{% load component_tags %}{% component name='incrementer' value='2' %}{% endcomponent %}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue