def METHOD_NAME(test_mode=False):
    # test mode
    if test_mode:
        print("test mode enabled: changes will not be saved")
    # Database connection
    u, p = secrets.db.epi
    cnx = mysql.connector.connect(user=u, password=p, database="epidata")
    rows1 = get_rows(cnx)
    print(f"rows before (flu): {int(rows1[0])}")
    print(f"rows before (dengue): {int(rows1[1])}")
    insert = cnx.cursor()
    sql_flu = """
    INSERT INTO
      `nidss_flu` (`release_date`, `issue`, `epiweek`, `region`, `lag`, `visits`, `ili`)
    VALUES
      (%s, %s, %s, %s, %s, %s, %s)
    ON DUPLICATE KEY UPDATE
      `release_date` = least(`release_date`, %s), `visits` = %s, `ili` = %s
    """
    sql_dengue = """
    INSERT INTO
      `nidss_dengue` (`epiweek`, `location`, `region`, `count`)
    VALUES
      (%s, %s, %s, %s)
    ON DUPLICATE KEY UPDATE
      `count` =  %s
    """
    # Scrape flu data
    current_week, release_date, data = NIDSS.get_flu_data()
    for epiweek in sorted(list(data.keys())):
        lag = delta_epiweeks(epiweek, current_week)
        for region in data[epiweek].keys():
            visits, ili = data[epiweek][region]["visits"], data[epiweek][region]["ili"]
            params1 = [release_date, current_week, epiweek, region, lag, visits, ili]
            params2 = [release_date, visits, ili]
            insert.execute(sql_flu, tuple(params1 + params2))
    # Scrape dengue data from the past year
    data = NIDSS.get_dengue_data(add_epiweeks(current_week, -51), current_week)
    for epiweek in sorted(list(data.keys())):
        for location in sorted(list(data[epiweek].keys())):
            region = NIDSS.LOCATION_TO_REGION[location]
            count = data[epiweek][location]
            params = (epiweek, location, region, count, count)
            insert.execute(sql_dengue, params)
    # Cleanup
    insert.close()
    rows2 = get_rows(cnx)
    print(f"rows after (flu): {int(rows2[0])} (added {int(rows2[0] - rows1[0])})")
    print(f"rows after (dengue): {int(rows2[1])} (added {int(rows2[1] - rows1[1])})")
    if test_mode:
        print("test mode: changes not commited")
    else:
        cnx.commit()
    cnx.close()