mirror of
https://github.com/django-components/django-components.git
synced 2025-08-03 22:08:17 +00:00
Rename duplicate ComponentRegistryTest.
Also move registry test to registry.
This commit is contained in:
parent
b30506087c
commit
c0c5a94908
2 changed files with 8 additions and 9 deletions
|
@ -8,15 +8,7 @@ from .testutils import Django30CompatibleSimpleTestCase as SimpleTestCase
|
|||
from django_components import component
|
||||
|
||||
|
||||
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)
|
||||
|
||||
class ComponentTest(SimpleTestCase):
|
||||
def test_empty_component(self):
|
||||
class EmptyComponent(component.Component):
|
||||
pass
|
||||
|
|
|
@ -12,6 +12,13 @@ class ComponentRegistryTest(unittest.TestCase):
|
|||
def setUp(self):
|
||||
self.registry = component.ComponentRegistry()
|
||||
|
||||
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_simple_register(self):
|
||||
self.registry.register(name="testcomponent", component=MockComponent)
|
||||
self.assertEqual(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue