'Test that we fail gracefully if the GeoIP server is down.'

@mock.patch.object(settings, 'GEOIP_DEFAULT_VAL', 'us')
@mock.patch('socket.socket')
@mock.patch('mkt.regions.set_region')
def test_geoip_down(self, set_region, mock_socket):

    mock_socket.connect.side_effect = IOError
    self.client.get('/api/v1/apps/', REMOTE_ADDR='127.0.0.1')
    set_region.assert_called_with(mkt.regions.USA)
