Code review comment for lp:~doanac/utah/server-cleanups

Revision history for this message
Javier Collado (javier.collado) wrote :

Thanks for the update. A few more comments:

- Test cases
The test cases are broken. It looks like the idea of initializing the template
environment at import time wasn't good for testing. The problem is the update
to `config.template_dir` in `tests/common.py` happens after
`template.as_buff._env` is already set.

I managed to make it work using something like this in `tests/common.py`:
from utah import template

...

def setUp():
    ....
    config.template_dir = ...
    reload(template)

However, I don't like much this trick, so I'll let you decide if you prefer
this or revert to the original code in which the environment was created when
the first template was rendered.

- Documentation
  - Please add ``utah.template`` to ``reference.rst``, so that it's included in
    the documentation.

  - Note that backslash characters must be escaped in the
    `_add_backslash_filter` documentation string to be properly rendered.
    Anyway, this not really an issue since private methods aren present in the
    documentation by default.

« Back to merge proposal