55from django import forms
66from tests .views .fake_components import (
77 FakeAuthenticationComponent ,
8+ FakeFormClassesComponent ,
89 FakeValidationComponent ,
910 FakeValidationForm ,
1011)
1112
1213from django_unicorn .components import UnicornView
1314from django_unicorn .serializer import InvalidFieldNameError
15+ from example .books .models import Book
1416
1517
1618class ExampleComponent (UnicornView ):
@@ -539,7 +541,6 @@ def test_form_classes_validate_all_fields_with_empty_object():
539541 title or date_published, calling ``validate()`` should populate errors for
540542 both ``book.title`` and ``book.date_published``.
541543 """
542- from tests .views .fake_components import FakeFormClassesComponent
543544
544545 component = FakeFormClassesComponent (component_id = "test_form_classes_validate_all" , component_name = "example" )
545546
@@ -556,7 +557,6 @@ def test_form_classes_validate_model_names_filtered():
556557 When ``model_names`` is specified, only the requested dotted keys should
557558 appear in the errors dict.
558559 """
559- from tests .views .fake_components import FakeFormClassesComponent
560560
561561 component = FakeFormClassesComponent (component_id = "test_form_classes_filtered" , component_name = "example" )
562562
@@ -568,7 +568,6 @@ def test_form_classes_validate_model_names_filtered():
568568
569569def test_form_classes_is_valid_with_empty_object ():
570570 """``is_valid()`` should return ``False`` when required object fields are missing."""
571- from tests .views .fake_components import FakeFormClassesComponent
572571
573572 component = FakeFormClassesComponent (component_id = "test_form_classes_is_valid_false" , component_name = "example" )
574573
@@ -580,9 +579,6 @@ def test_form_classes_validate_stale_errors_removed():
580579 Errors for an object field that has since become valid should be removed on
581580 the next ``validate()`` call.
582581 """
583- from tests .views .fake_components import FakeFormClassesComponent
584-
585- from example .books .models import Book
586582
587583 component = FakeFormClassesComponent (component_id = "test_form_classes_stale_errors" , component_name = "example" )
588584
0 commit comments