def createProductInstance(productTemplateId, accountTemplateId, definition, contentType="text/xml"): testData = t_utils.getTestData(definition, substitutions={ "{templateId}": productTemplateId, "{accountTemplateId}": accountTemplateId }) return o_utils.createInstance("product", testData, contentType=contentType)
def createSubscriptionInstance(subscriptionTemplateId, userTemplateId, productId, userId, shortCode, definition): testData = t_utils.getTestData(definition, substitutions={ "{templateId}": subscriptionTemplateId, "{userTemplateId}": userTemplateId, "{productId}": productId, "{userId}": userId, "{shortCode}": shortCode }) return o_utils.createInstance("subscription", testData)
}) return o_utils.createInstance("product", testData, contentType=contentType) def createUserInstance(userTemplateId, accountId, definition, case=None, contentType="text/xml"): testData = t_utils.getTestData(definition, substitutions={ "{templateId}": userTemplateId, "{accountId}": accountId }, case=case) return o_utils.createInstance("user", testData, contentType=contentType) def createSubscriptionInstance(subscriptionTemplateId, userTemplateId, productId, userId, shortCode, definition): testData = t_utils.getTestData(definition, substitutions={ "{templateId}": subscriptionTemplateId, "{userTemplateId}": userTemplateId, "{productId}": productId, "{userId}": userId, "{shortCode}": shortCode }) return o_utils.createInstance("subscription", testData)
def createAccountInstance(accountTemplateId, userTemplateId, productId, subProductId1, subProductId2, userId, shortCode, definition, case=0, contentType="text/xml"): testData = t_utils.getTestData(definition, substitutions = {"{templateId}":accountTemplateId,"{userTemplateId}":userTemplateId,"{productId}":productId,"{eCntProductId}":subProductId1,"{eCKProductId}":subProductId2,"{userId}":userId,"{shortCode}":shortCode}, case=case) #print testData return o_utils.createInstance("account", testData, contentType=contentType)
def createSubscriptionInstance(subscriptionTemplateId, userTemplateId, productId, userId, shortCode, definition): testData = t_utils.getTestData(definition, substitutions = {"{templateId}":subscriptionTemplateId,"{userTemplateId}":userTemplateId,"{productId}":productId,"{userId}":userId,"{shortCode}":shortCode}) return o_utils.createInstance("subscription", testData)
def createUserInstance(userTemplateId, accountId, definition, case=None, contentType="text/xml"): testData = t_utils.getTestData(definition, substitutions = {"{templateId}":userTemplateId, "{accountId}": accountId}, case=case) return o_utils.createInstance("user", testData, contentType=contentType)
def createProductInstance(productTemplateId, accountTemplateId, definition, contentType="text/xml"): testData = t_utils.getTestData(definition, substitutions = {"{templateId}":productTemplateId, "{accountTemplateId}":accountTemplateId}) return o_utils.createInstance("product", testData, contentType=contentType)