'Given a user preference object, get the URI for the corresponding resource'

def get_uri_for_pref(self, target_pref):

    prefs = self.get_json(USER_PREFERENCE_LIST_URI)['results']
    for pref in prefs:
        if ((pref['user']['id'] == target_pref.user.id) and (pref['key'] == target_pref.key)):
            return pref['url']
    self.fail()
