Skip to content

Commit

Permalink
point everything at L{DanglingField}
Browse files Browse the repository at this point in the history
  • Loading branch information
glyph committed Aug 15, 2023
1 parent 9251864 commit e89be2a
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/klein/test/test_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,22 @@ def procureASession(self, request: IRequest) -> Any:
dangling=DanglingField(lambda x: x, "text"),
)
def danglingParameter(self, dangling: str) -> None:
"..."
"""
Provided to test error reporting on handling of dangling fields.
@see: L{DanglingField}
"""

@requirer.require(
router.route("/dangling-param", methods=["GET"]),
form=Form.rendererFor(danglingParameter, action="/dangling-param"),
)
def renderDanglingParameter(self, form: Form) -> Form:
"""
Provided to test error reporting on rendering of dangling fields.
@see: L{DanglingField}
"""
return form

@requirer.require(
Expand Down Expand Up @@ -354,7 +363,10 @@ def test_missingRequiredParameter(self) -> None:
def test_noName(self) -> None:
"""
A handler for a Form with a Field that doesn't have a name will return
an error explaining the problem.
an error explaining the problem when either processed in a handler or
rendered in a form.
@see: L{DanglingField}.
"""
mem = MemorySessionStore()
session = self.successResultOf(
Expand Down

0 comments on commit e89be2a

Please sign in to comment.