def item_to_someday(item_id): uid = current_user.get_obj_id() item = ItemRepo.item_to_someday(item_id, uid) if not item: return json.dumps({"success": False}) else: return json.dumps({"success": True, "data": item})
def test_item_to_someday(resource): user_id = resource item = ItemRepo.add_item(description="This is an item", location="inbox", user=user_id) someday_item = ItemRepo.item_to_someday(item["id"], user_id) assert someday_item is not None assert item["id"] == someday_item["id"] assert item["description"] == someday_item["description"] assert someday_item["location"] == "someday/maybe"