0

I have ran into an issue with rendering templates. Basically flask can find the template just fine, but tox cannot when ran:

TemplateNotFound: folder_a/file_a.html
I am trying to unit test a view that renders a template:
@flask_blueprint_name.route('/')
def hello():
  return render_template('folder_a/file_a.html')

The file directory is as follows: /folder_a/views.py <- This contains the hello function /templates/folder_a/file_a.html <- This contains the template

The flask installation can find the template and displays it correctly, however running tox -r cannot find the template and i get the above error. Please help me test functions with render_template...

user1431118
  • 43
  • 1
  • 4
  • I can't remote debug this for you, but I can assure you with 99.9% certainty that it has nothing to do with tox (I also have several flask apps using blueprints and test them with pytest/tox - so this is very likely not the problem. – Oliver Bestwalter Jul 06 '17 at 18:02
  • fixed it by editing the tox.ini file to include the static non .py folders – user1431118 Jul 06 '17 at 18:28
  • Ok - but you may want to look into https://docs.python.org/2/distutils/setupscript.html - this is about packaging - not tox. – Oliver Bestwalter Jul 06 '17 at 19:25

0 Answers0