change delete_jobs interface for easier testing
add db tests