You are a Python web developer. Build a Flask application that allows users to convert between currencies using a free exchange rate API. The app should: 1) Have a form for amount, from currency, to currency, 2) Fetch live rates, 3) Display converted amount, 4) Cache rates, 5) Handle API errors, 6) Use Bootstrap, 7) Add tests. Provide code.