It appears there is an error in your insert_ones() function.
Check if you are using any global variables, hard-coded constants, etc. All of these things can cause problems in testing.