- test_atomic_settings.py: Atomic write operation tests - test_csv_quoting.py: CSV QUOTE_MINIMAL protection tests - test_complete_csv_sanitization.py: Full field sanitization tests - test_input_sanitization.py: Input validation and security tests - test_alternating_colors.py: Visual enhancement tests - test_mark_billed.py & test_mark_logic.py: Existing functionality tests All tests passing with comprehensive security coverage.
28 lines
2.0 KiB
Python
28 lines
2.0 KiB
Python
#!/usr/bin/env python3
|
|
|
|
# Quick test to verify the mark as billed functionality
|
|
import csv
|
|
import os
|
|
from datetime import datetime, date
|
|
|
|
# Create test archive data if it doesn't exist
|
|
if not os.path.exists("time_tracker_archive.csv"):
|
|
with open("time_tracker_archive.csv", 'w', newline='', encoding='utf-8') as f:
|
|
writer = csv.writer(f)
|
|
writer.writerow(['Job', 'TaskName', 'Note', 'Customer', 'Hours', 'Date', 'username', 'Billable', 'Billed'])
|
|
writer.writerow(['Development', 'Web Portal Update', 'Updated user interface', 'Client Corp', '4.5', '2025-10-01', 'eric', 'true', 'false'])
|
|
writer.writerow(['Troubleshooting', 'Bug Fix 123', 'Fixed critical bug', 'Internal', '2.0', '2025-10-01', 'eric', 'true', 'false'])
|
|
writer.writerow(['Meeting', 'Client Meeting', 'Quarterly review', 'Client Corp', '1.5', '2025-10-02', 'eric', 'false', 'false'])
|
|
writer.writerow(['Development', 'API Integration', 'Connected payment gateway', 'Client Corp', '6.0', '2025-10-02', 'eric', 'true', 'false'])
|
|
writer.writerow(['Admin', 'Documentation', 'Updated API docs', 'Internal', '1.0', '2025-10-03', 'eric', 'false', 'false'])
|
|
writer.writerow(['Development', 'Database Migration', 'Migrated to new server', 'Client Corp', '3.5', '2025-10-03', 'eric', 'true', 'false'])
|
|
writer.writerow(['Troubleshooting', 'Server Issues', 'Fixed server downtime', 'Internal', '2.5', '2025-10-04', 'eric', 'true', 'false'])
|
|
writer.writerow(['Meeting', 'Team Standup', 'Daily sync', 'Internal', '0.5', '2025-10-04', 'eric', 'false', 'false'])
|
|
writer.writerow(['Development', 'Feature X', 'New reporting feature', 'Client Corp', '5.0', '2025-10-05', 'eric', 'true', 'false'])
|
|
|
|
print("Test archive data created. You can now run the time tracker application and:")
|
|
print("1. Click 'Build Our Details Report'")
|
|
print("2. Select 'Client Corp' as customer")
|
|
print("3. Set date range from 2025-10-01 to 2025-10-05")
|
|
print("4. Click 'Generate Report'")
|
|
print("5. Click 'Mark as Billed' to test the new functionality") |