test_url_generation_with_proxy: do not use contextlib.nested()

This method does not exist in Python 3, use the "@mock.patch.object" decorator
instead.

Change-Id: Ic45fea1553320c61be284a9397b54fd32f7d30ef