+@CGI.subcommand(
+ 'warn', ['cgi-noauth'],
+ 'Raise an exception, to test the error reporting machinery.')
+def cmd_warn_cgi():
+ OUT.header(content_type = 'text/html')
+ OUT.warn("Here's a very important warning.")
+ CGI.format_tmpl(CGI.TMPL['wrapper.fhtml'],
+ title = "Warning test", warnings = OUT.warnings,
+ payload = "<h1>Chopwood: warning test</h1>\n"
+ "<p>There ought to be a warning below.\n")
+