def save(self, doc):
        if doc.id:
            return self.update(doc)
        else:
            return self.insert(doc)
def step_impl(context, user_name):
    context.token = context.users[user_name]['token']