Changed tests to run assertions inside transactions