'Mock for the GeoIP module.'

@contextmanager
def _mock_geoip(self, country_code):

    with mock.patch.object(pygeoip.GeoIP, 'country_code_by_addr') as mock_ip:
        mock_ip.return_value = country_code
        (yield)
