Refactor database url to a separate file and test