tcms.xmlrpc.api.testplan module

tcms.xmlrpc.api.testplan.create(values, **kwargs)[source]
XML-RPC TestPlan.create(values)

Create new Test Plan object and store it in the database.

Parameters:values (dict) – Field values for tcms.testplans.models.TestPlan
Returns:Serialized tcms.testplans.models.TestPlan object
Return type:dict
Raises:PermissionDenied if missing testplans.add_testplan permission
Raises:ValueError if data validation fails

Minimal parameters:

>>> values = {
    'product': 61,
    'name': 'Testplan foobar',
    'type': 1,
    'parent_id': 150,
    'default_product_version': 93,
    'text':'Testing TCMS',
}
>>> TestPlan.create(values)
tcms.xmlrpc.api.testplan.update(plan_id, values)[source]
XML-RPC TestPlan.update(plan_id, values)

Update the fields of the selected test plan.

Parameters:
Returns:

Serialized tcms.testplans.models.TestPlan object

Return type:

dict

Raises:

TestPlan.DoesNotExist if object specified by PK doesn’t exist

Raises:

PermissionDenied if missing testplans.change_testplan permission

Raises:

ValueError if validations fail

tcms.xmlrpc.api.testplan.filter(query=None)[source]
XML-RPC TestPlan.filter(query)

Perform a search and return the resulting list of test plans.

Parameters:query (dict) – Field lookups for tcms.testplans.models.TestPlan
Returns:List of serialized tcms.testplans.models.TestPlan objects
Return type:list(dict)
tcms.xmlrpc.api.testplan.add_case(plan_id, case_id)[source]
XML-RPC TestPlan.add_case(plan_id, case_id)

Link test case to the given plan.

Parameters:
  • plan_id (int) – PK of TestPlan to modify
  • case_id (int) – PK of TestCase to be added to plan
Returns:

None

Raises:

TestPlan.DoesNotExit or TestCase.DoesNotExist if objects specified by PKs are missing

Raises:

PermissionDenied if missing testcases.add_testcaseplan permission

tcms.xmlrpc.api.testplan.remove_case(plan_id, case_id)[source]
XML-RPC TestPlan.remove_case(plan_id, case_id)

Unlink a test case from the given plan.

Parameters:
  • plan_id (int) – PK of TestPlan to modify
  • case_id (int) – PK of TestCase to be removed from plan
Returns:

None

Raises:

PermissionDenied if missing testcases.delete_testcaseplan permission

tcms.xmlrpc.api.testplan.add_tag(plan_id, tag_name, **kwargs)[source]
XML-RPC TestPlan.add_tag(plan_id, tag_name)

Add a tag to the specified test plan.

Parameters:
  • plan_id (int) – PK of TestPlan to modify
  • tag_name (str) – Tag name to add
Returns:

None

Raises:

PermissionDenied if missing testplans.add_testplantag permission

Raises:

TestPlan.DoesNotExist if object specified by PK doesn’t exist

Raises:

Tag.DoesNotExist if missing management.add_tag permission and tag_name doesn’t exist in the database!

tcms.xmlrpc.api.testplan.remove_tag(plan_id, tag_name)[source]
XML-RPC TestPlan.remove_tag(plan_id, tag_name)

Remove tag from the specified test plan.

Parameters:
  • plan_id (int) – PK of TestPlan to modify
  • tag_name (str) – Tag name to remove
Returns:

None

Raises:

PermissionDenied if missing testplans.delete_testplantag permission

Raises:

DoesNotExist if objects specified don’t exist