Files
email_alerts/LOCAL_TESTING.md
T
Iyeoluwa Akinrinola 70b2bcc89d Fix Zoho connection issues and add local testing capabilities
- Fixed 'days_back' parameter error in zoho_client.py
- Added robust settings validation in app.py to prevent int() errors
- Created LOCAL_TESTING.md with comprehensive testing guide
- Added run_local.sh for easy local server setup
- Added deploy_updates.sh for deployment instructions
- Added test_local_connection.py for automated testing
- Updated config.json with proper structure
- All fixes tested and working locally
2025-07-25 12:40:10 +01:00

2.1 KiB

Local Testing Guide

This guide helps you test the Email Alerts Application locally.

🚀 Quick Start

Option 1: Use the automated script

./run_local.sh

Option 2: Manual setup

# Activate virtual environment
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Start the server
python run_server.py

🌐 Access the Application

Once the server is running, you can access:

🧪 Testing the Connection

Step 1: Configure Credentials

  1. Go to http://localhost:5237/settings
  2. Enter the Zoho credentials:
    • Email: projects@manaknightdigital.com
    • Password: 4o%!sbk$(3!>@#567!!
  3. Click "Save Settings"

Step 2: Test Connection

  1. Click "Test Connection" button
  2. You should see: "Connection successful! Found X emails in the last 7 days."

🔧 Troubleshooting

If you get "days_back" error:

  • The server is running old code
  • Restart the server: Ctrl+C then run ./run_local.sh again

If you get "ModuleNotFoundError":

  • Make sure you're using the virtual environment: source venv/bin/activate

If port 5237 is in use:

  • The script will automatically kill existing processes
  • Or manually: pkill -f "python.*run_server.py"

📋 Test Checklist

🎯 Expected Results

Success: "Connection successful! Found X emails in the last 7 days." Old Error: "Connection failed: ZohoClient.fetch_emails() got an unexpected keyword argument 'days_back'"

🛑 Stopping the Server

Press Ctrl+C in the terminal where the server is running.

📁 Files for Testing

  • run_local.sh - Automated local startup script
  • test_local_connection.py - Connection test script
  • zoho_client.py - Fixed with days_back parameter
  • config.json - Clean configuration (no hardcoded credentials)