Fix failing test test_prepare_unicode_url

Test was failing in case of undefined `hooks` in prepare_hooks()