tests: add last insertion query in unit tests