Changed tests to do assertions inside transactions