@mock.patch(PYCOUNTRY)
def test_lookup_via_official_name(self, mocked_pycountry):
    mocked_pycountry.side_effect = [KeyError(), KeyError(), 'country_object']
    expected_calls = [mock.call(name='United Kingdom'), mock.call(common_name='United Kingdom'), mock.call(official_name='United Kingdom')]
    assert (country_iso_code('United Kingdom') == 'country_object')
    assert (mocked_pycountry.mock_calls == expected_calls)
    assert (mocked_pycountry.call_count == 3)
    country_iso_code.cache_clear()
@mock.patch(PYCOUNTRY)
def test_lookup_via_official_name(self, mocked_pycountry):
    mocked_pycountry.side_effect = [KeyError(), KeyError(), 'country_object']
    expected_calls = [mock.call(name='United Kingdom'), mock.call(common_name='United Kingdom'), mock.call(official_name='United Kingdom')]
    assert (country_iso_code('United Kingdom') == 'country_object')
    assert (mocked_pycountry.mock_calls == expected_calls)
    assert (mocked_pycountry.call_count == 3)
    country_iso_code.cache_clear()