Refactor unit.test_client with the mock library.