ubuntu.com icon indicating copy to clipboard operation
ubuntu.com copied to clipboard

test_tutorials_search test fails without authentication key

Open nottrobin opened this issue 2 years ago • 2 comments

Unit tests should be able to run independently of external services, but test_tutorials_search is showing a 500 auth error when the key isn't provided, which suggests it's still calling the API every time.

This should be being taken care of by VCR, and I can't figure out immediately why it's not. Worth looking into.

nottrobin avatar May 04 '23 09:05 nottrobin

I believe it's because we are initialising in the main app.py, not when we are actually using the API endpoint. So when the key isn't provided, it can't even run the site.

carkod avatar May 24 '23 08:05 carkod

Sounds likely. So can we make the key optional? Is it as simple as os.getenv("KEY") rather than os.environ["KEY"]? (I haven't looked into this at all)

nottrobin avatar May 26 '23 09:05 nottrobin