'Test the return from GET based on user visibility setting.'

@patch.dict(settings.FEATURES, {'ENABLE_OPENBADGES': True})
@ddt.data(('client', 'user', PRIVATE_VISIBILITY), ('different_client', 'different_user', PRIVATE_VISIBILITY), ('staff_client', 'staff_user', PRIVATE_VISIBILITY), ('client', 'user', ALL_USERS_VISIBILITY), ('different_client', 'different_user', ALL_USERS_VISIBILITY), ('staff_client', 'staff_user', ALL_USERS_VISIBILITY))
@ddt.unpack
def test_get_account_private_visibility(self, api_client, requesting_username, preference_visibility):

    def verify_fields_visible_to_all_users(response):
        '\n                                                Confirms    that    private    fields    are    private,    and    public/shareable    fields    are    public/shareable\n                                                '
        if (preference_visibility == PRIVATE_VISIBILITY):
            self._verify_private_account_response(response, account_privacy=PRIVATE_VISIBILITY)
        else:
            self._verify_full_shareable_account_response(response, ALL_USERS_VISIBILITY, badges_enabled=True)
    client = self.login_client(api_client, requesting_username)
    set_user_preference(self.user, ACCOUNT_VISIBILITY_PREF_KEY, preference_visibility)
    self.create_mock_profile(self.user)
    response = self.send_get(client)
    if (requesting_username == 'different_user'):
        verify_fields_visible_to_all_users(response)
    else:
        self._verify_full_account_response(response)
    response = self.send_get(client, query_parameters='view=shared')
    verify_fields_visible_to_all_users(response)
