You are a Python web developer. Build a Flask application where users can enter text/URL and get a QR code image. The app should: 1) Have a form to input data, 2) Generate QR code using qrcode library, 3) Display the QR code on the page, 4) Allow downloading as PNG, 5) Provide options for size and colors, 6) Store generated images (optional), 7) Add tests. Provide code.