Thanks for a very clear statement of the situation.
Your question more-or-less works on my machine, although I needed to add the parameter universal_newlines=False to the call to subprocess to avoid binary output. I also had to change the tests to use python3 (see below). But I certainly never got a 'python not found' exception.
That error means that there's no executable command 'python' to be found on your Jobe server, at least not within the set of directories specified by the current PATH environment variable. That's a bit surprising. On my Jobe servers, python is at /usr/bin/python, although that runs python2, not python3.
Clearly you do have a python on your system, since it's running the template. However, the template is running using python3 not python2. Is it possible you have a Jobe server with only python3 on it, and no python2? If that's the case your problem may be solved simply by changing your question's tests to use the command python3 rather than just python.
Otherwise, I think you'll have to explore a bit more. Perhaps the best way to figure out what's going on is to temporarily change your tests to run various bash commands instead of python commands, e.g.
bash echo $PATH
bash which python
bash which python3