'Sets the url attribute including the username and provided preference key'

def _set_url(self, preference_key):

    self.url = reverse(self.url_endpoint_name, kwargs={'username': self.user.username, 'preference_key': preference_key})
