Improve slot handling to allow nested components, conditional slots, and slot.super (Fixes #33, #34, #37)

Co-authored-by: rbeard0330 <@dul2k3BKW6m>
This commit is contained in:
rbeard0330 2021-05-25 18:55:40 -04:00 committed by Emil Stenström
parent c4db1646db
commit 070b754d24
7 changed files with 459 additions and 69 deletions

View file

@ -91,8 +91,7 @@ class RenderBenchmarks(SimpleTestCase):
"{% component 'inner_component' variable='foo' %}{% endslot %}{% endcomponent_block %}",
name='root')
# Sanity tests
response = create_and_process_template_response(template)
response_content = response.content.decode('utf-8')
response_content = create_and_process_template_response(template)
self.assertNotIn(CSS_DEPENDENCY_PLACEHOLDER, response_content)
self.assertNotIn(JS_DEPENDENCY_PLACEHOLDER, response_content)
self.assertIn('style.css', response_content)
@ -109,8 +108,7 @@ class RenderBenchmarks(SimpleTestCase):
from django.template.loader import get_template
template = get_template('mdn_complete_page.html')
response = create_and_process_template_response(template, {})
response_content = response.content.decode('utf-8')
response_content = create_and_process_template_response(template, {})
self.assertNotIn(CSS_DEPENDENCY_PLACEHOLDER, response_content)
self.assertNotIn(JS_DEPENDENCY_PLACEHOLDER, response_content)
self.assertIn('test.css', response_content)