def method_mock(request, cls, method_name, **kwargs):
    _patch = patch.object(cls, method_name, **kwargs)
    request.addfinalizer(_patch.stop)
    return _patch.start()
Check that the shortcut view (used for the admin "view on site"
dataset/ETHPy150Open python-openxml/python-docx/tests/unitutil/mock.py/method_mock--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.2/django/contrib/contenttypes/tests.py/ContentTypesTests.test_shortcut_view