Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class {{MODULE_NAME}}Module(ModuleBase):
meta = ModuleMeta(
name="{{MODULE_NAME}}",
route_prefix="/api/{{MODULE_SLUG}}",
view_prefix="/{{MODULE_SLUG}}",
depends_on=[],
version="0.1.0",
requires_framework=">=1.0,<2.0",
Expand Down
14 changes: 14 additions & 0 deletions framework/cli/tests/test_cli_new_regressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ def test_sm_new_sample_module_seeds_static_dist_placeholder(tmp_path: Path) -> N
assert static_dist.is_dir(), "static/dist/ must exist for hatch force-include"


def test_sm_new_sample_module_does_not_declare_view_prefix(tmp_path: Path) -> None:
"""Issue #138: fresh scaffold must not declare view_prefix so it boots
without an SM019 warning (view routes registered but no menu entry or
permissions)."""
runner = CliRunner()
target = tmp_path / "demo"
runner.invoke(
app,
["new", "demo", "--yes", "--db", "sqlite", "--no-install", "--dest", str(target)],
)
module_py = (target / "modules" / "hello" / "hello" / "module.py").read_text()
assert "view_prefix" not in module_py


def test_sm_new_registers_landing_route_at_root(tmp_path: Path) -> None:
"""Issue #137: the Quickstart promises a landing page at ``http://localhost:8000``,
so a fresh scaffold must register a ``/`` route and ship the matching
Expand Down
Loading