def create_testcycle_with_name(step, stored, name): testcycleModel = TestcycleModel() name = testcycleModel.get_stored_or_store_name(stored, name) post_payload = {"name": name, "description": "Ahh, the cycle of life...", "productId": ProductModel().get_seed_resid()[0], "startDate": "2011/02/02", "communityAuthoringAllowed": "true", "communityAccessAllowed": "true", "endDate": "2014/02/02" } testcycleModel.create(post_payload)
def create_testcycle_with_name(step, stored, name): testcycleModel = TestcycleModel() name = testcycleModel.get_stored_or_store_name(stored, name) post_payload = { "name": name, "description": "Ahh, the cycle of life...", "productId": ProductModel().get_seed_resid()[0], "startDate": "2011/02/02", "communityAuthoringAllowed": "true", "communityAccessAllowed": "true", "endDate": "2014/02/02" } testcycleModel.create(post_payload)
def create_testcycles(step): testcycleModel = TestcycleModel() for item in step.hashes: # must do this or it will freak out the lettuce reporting, because # we delete items from this before submitting. testcycle = item.copy() # get the product id from the passed product name product_id = ProductModel().get_resid(testcycle["product name"])[0] testcycle["productId"] = product_id if testcycle.has_key('product name'): del testcycle['product name'] testcycleModel.create(testcycle)