More comments.
Raise Unauthorized exception when the template is not allowed to be
generated.
Test generation view.
Test document generation methods.
Test document generation view call.