mirror of
https://github.com/django-components/django-components.git
synced 2025-10-17 01:07:12 +00:00
Class decorator and test
This commit is contained in:
parent
bb3193cd4c
commit
10a117ee88
2 changed files with 25 additions and 0 deletions
|
@ -9,6 +9,14 @@ from .testutils import Django111CompatibleSimpleTestCase as SimpleTestCase
|
|||
|
||||
|
||||
class ComponentRegistryTest(SimpleTestCase):
|
||||
|
||||
def test_register_class_decorator(self):
|
||||
@component.register("decorated_component")
|
||||
class TestComponent(component.Component):
|
||||
pass
|
||||
|
||||
self.assertEqual(component.registry.get("decorated_component"), TestComponent)
|
||||
|
||||
def test_empty_component(self):
|
||||
class EmptyComponent(component.Component):
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue