Store tests and subcases in the database