mirror of
https://github.com/django-components/django-components.git
synced 2025-08-03 22:08:17 +00:00
feat: expose _class_hash as class_id (#1094)
* feat: expose _class_hash as class_id * refactor: fix linting
This commit is contained in:
parent
a49f5e51dd
commit
bb5de86b69
13 changed files with 141 additions and 82 deletions
|
@ -16,7 +16,7 @@ from django.test import Client
|
|||
from django.urls import path
|
||||
from pytest_django.asserts import assertHTMLEqual, assertInHTML
|
||||
|
||||
from django_components import Component, ComponentView, all_components, register, types
|
||||
from django_components import Component, ComponentView, all_components, get_component_by_class_id, register, types
|
||||
from django_components.slots import SlotRef
|
||||
from django_components.urls import urlpatterns as dc_urlpatterns
|
||||
|
||||
|
@ -356,6 +356,12 @@ class TestComponent:
|
|||
):
|
||||
Root.render()
|
||||
|
||||
def test_get_component_by_id(self):
|
||||
class SimpleComponent(Component):
|
||||
pass
|
||||
|
||||
assert get_component_by_class_id(SimpleComponent.class_id) == SimpleComponent
|
||||
|
||||
|
||||
@djc_test
|
||||
class TestComponentRender:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue