55from django import forms
66from tests .views .fake_components import (
77 FakeAuthenticationComponent ,
8+ FakeFormClassesComponent ,
89 FakeValidationComponent ,
910)
1011
1112from django_unicorn .components import UnicornView
1213from django_unicorn .serializer import InvalidFieldNameError
14+ from example .books .models import Book
1315
1416
1517class ExampleComponent (UnicornView ):
@@ -414,7 +416,6 @@ def test_form_classes_validate_all_fields_with_empty_object():
414416 title or date_published, calling ``validate()`` should populate errors for
415417 both ``book.title`` and ``book.date_published``.
416418 """
417- from tests .views .fake_components import FakeFormClassesComponent
418419
419420 component = FakeFormClassesComponent (component_id = "test_form_classes_validate_all" , component_name = "example" )
420421
@@ -431,7 +432,6 @@ def test_form_classes_validate_model_names_filtered():
431432 When ``model_names`` is specified, only the requested dotted keys should
432433 appear in the errors dict.
433434 """
434- from tests .views .fake_components import FakeFormClassesComponent
435435
436436 component = FakeFormClassesComponent (component_id = "test_form_classes_filtered" , component_name = "example" )
437437
@@ -443,7 +443,6 @@ def test_form_classes_validate_model_names_filtered():
443443
444444def test_form_classes_is_valid_with_empty_object ():
445445 """``is_valid()`` should return ``False`` when required object fields are missing."""
446- from tests .views .fake_components import FakeFormClassesComponent
447446
448447 component = FakeFormClassesComponent (component_id = "test_form_classes_is_valid_false" , component_name = "example" )
449448
@@ -455,9 +454,6 @@ def test_form_classes_validate_stale_errors_removed():
455454 Errors for an object field that has since become valid should be removed on
456455 the next ``validate()`` call.
457456 """
458- from tests .views .fake_components import FakeFormClassesComponent
459-
460- from example .books .models import Book
461457
462458 component = FakeFormClassesComponent (component_id = "test_form_classes_stale_errors" , component_name = "example" )
463459
0 commit comments