test: remove duplicated database setup code