added tests for new db insertion code