refactor(tests): extract CRUD/query logic to test_crud_service, router delegates to service with domain exceptions
This commit is contained in:
@@ -101,7 +101,7 @@ from app.routers.test_templates import (
|
||||
toggle_template_active,
|
||||
template_stats,
|
||||
)
|
||||
from app.routers.tests import create_test_from_template
|
||||
from app.services.test_crud_service import create_test_from_template as crud_create_from_template
|
||||
from app.schemas.test_template import TestTemplateCreate
|
||||
|
||||
|
||||
@@ -174,7 +174,8 @@ def test_get_templates_by_technique():
|
||||
|
||||
def test_instantiate_template():
|
||||
"""POST /tests/from-template creates a test pre-filled from template data."""
|
||||
source = inspect.getsource(create_test_from_template)
|
||||
# Template field copying lives in the service; router delegates to it
|
||||
source = inspect.getsource(crud_create_from_template)
|
||||
|
||||
# Verify it reads from template and copies fields
|
||||
assert "template" in source, "Must reference template"
|
||||
|
||||
Reference in New Issue
Block a user