Can you help me, with tests in my app?  
now, i have
utils.py
import pandas as pd
from joblib import load
from flask import render_template, request, jsonify, redirect, url_for
import numpy as np
import requests

loaded_model = load('ml/best_salary_model2.joblib')
data = pd.read_csv('data/data.csv')

experience_levels = data['experience_level'].unique().tolist()
employment_types = data['employment_type'].unique().tolist()
employee_residences = data['employee_residence'].unique().tolist()
job_titles = data['job_title'].unique().tolist()

def calculate_mean_salary(data, job_titles):
    if isinstance(data, pd.DataFrame):
        selected_titles = data[data['job_title'].isin(job_titles)]
        mean_salary = selected_titles['salary_in_usd'].mean()
        return mean_salary
    else:
        return None

def home():
    return render_template('index.html', 
                           experience_levels=experience_levels,
                           employment_types=employment_types,
                           employee_residences=employee_residences,
                           job_titles=job_titles)

def get_data():
    return jsonify({
        'experience_levels': experience_levels,
        'employment_types': employment_types,
        'employee_residences': employee_residences,
        'job_titles': job_titles
    })

def get_salary_data_from_api(job_title, location):
    url = "https://job-salary-data.p.rapidapi.com/job-salary"
    querystring = {"job_title": job_title, "location": location, "radius": "200"}
    headers = {
        # "X-RapidAPI-Key": "db35cfba2bmsh0fabb7b412dd639p126722jsnabe8eab1e4aa",
        "X-RapidAPI-Host": "job-salary-data.p.rapidapi.com"
    }
    response = requests.get(url, headers=headers, params=querystring)
    if response.status_code == 200:
        data = response.json()
        if data["status"] == "OK":
            return data["data"]
    return []

def predict(request):
    data = request.get_json()
    if data is None or 'experience_level' not in data:
        return jsonify({'error': 'Invalid data: experience_level is missing'}), 400

    experience_level = data['experience_level']
    employment_type = data['employment_type']
    job_title = data['job_title']
    employee_residence = data['employee_residence']
    remote_ratio = float(data.get('remote_ratio', 100))  # Default to 100% if not provided

    user_input = pd.DataFrame({
        'experience_level': [experience_level],
        'employment_type': [employment_type],
        'job_title': [job_title],
        'employee_residence': [employee_residence],
        'remote_ratio': [remote_ratio]
    })

    predicted_salary = loaded_model.predict(user_input)[0]
    predicted_salary_str = str(predicted_salary)

    return redirect(url_for('prediction_routes.result', predicted_salary=predicted_salary_str, job_title=job_title, employee_residence=employee_residence))

def display_data():
    data = pd.read_csv('data/data.csv')
    return render_template('data.html', data=data.to_html())

def display_graphs(): 
    return render_template('graphs.html')


routes.py
v
from flask import Blueprint, render_template, request, jsonify, redirect, url_for
from utils import home, predict, get_salary_data_from_api, display_graphs
import logging 
from flask import current_app
prediction_routes = Blueprint('prediction_routes', __name__)
@prediction_routes.route('/predict', methods=['POST'])
def prediction():
       try:
           current_app.logger.info('Submission received successfully')
           return predict(request)
    
       except Exception as e:
           current_app.logger.error('Error in prediction route: %s', str(e))

@prediction_routes.route('/ping')
def ping():
       try:
                return jsonify({'status': 'up'})
       except Exception as e:
                current_app.logger.error('Error ing ping route: %s',  str(e) )
                return jsonify({'error': 'An error occured'}), 500

    
@prediction_routes.route('/')
def index():
    return home()

@prediction_routes.route('/result', methods=['GET'])
def result():
    try:
        predicted_salary = float(request.args.get('predicted_salary'))
        job_title = request.args.get('job_title')
        employee_residence = request.args.get('employee_residence')
        if predicted_salary is None or job_title is None or employee_residence is None:
                        raise ValueError('Missing input data')
            

      
        api_data = get_salary_data_from_api(job_title, employee_residence)
        formatted_predicted_salary = f"${predicted_salary:,.0f}"

        return render_template('result.html', 
                               predicted_salary=formatted_predicted_salary, 
                               api_data=api_data)
    except ValueError as e:
        current_app.logger.error('Error in result route: %s', str(e) )
        return jsonify({'error': 'Invalid predicted salary provided'}), 400

@prediction_routes.route('/graphs', methods=['GET'])
def graphs():
    try:
        return display_graphs()
    except Exception as e:
        current_app.logger.error('Error in graphs route: %s', str(e))
        return jsonify({'error': 'An error occurred'}), 500

@prediction_routes.route('/report', methods=['GET'])
def report():
    try: 
        return render_template('report.html')
    except Exception as e:
        current_app.logger.error('Error in predictions route: %s', str(e))
        return jsonify({'error': 'An error occurred'}), 500


now, i will share my tests files and conf, okk?