mirror of
https://github.com/django-components/django-components.git
synced 2025-08-04 06:18:17 +00:00
refactor: replace bs4 and perf optimizations (#927)
This commit is contained in:
parent
d407a8cd13
commit
0b65761fce
19 changed files with 2078 additions and 418 deletions
|
@ -36,6 +36,9 @@ class BaseTestCase(SimpleTestCase):
|
|||
if template_cache:
|
||||
template_cache.clear()
|
||||
|
||||
from django_components.component import component_node_subclasses_by_name
|
||||
component_node_subclasses_by_name.clear()
|
||||
|
||||
# Mock the `generate` function used inside `gen_id` so it returns deterministic IDs
|
||||
def _start_gen_id_patch(self):
|
||||
# Random number so that the generated IDs are "hex-looking", e.g. a1bc3d
|
||||
|
@ -182,6 +185,9 @@ def parametrize_context_behavior(cases: List[ContextBehParam], settings: Optiona
|
|||
if template_cache: # May be None if the cache was not initialized
|
||||
template_cache.clear()
|
||||
|
||||
from django_components.component import component_node_subclasses_by_name
|
||||
component_node_subclasses_by_name.clear()
|
||||
|
||||
case_has_data = not isinstance(case, str)
|
||||
|
||||
if isinstance(case, str):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue