Adding safeguard for tests and automatically decorate the setup and teardown functions to populate and clean the test database