tcms.xmlrpc.api.bug module

tcms.xmlrpc.api.bug.create(values)[source]
XML-RPC Bug.create(values)

Attach a bug to pre-existing TestCase or TestCaseRun object.

Parameters:values (dict) – Field values for tcms.testcases.models.Bug
Returns:Serialized tcms.testcases.models.Bug object
Raises:PermissionDenied if missing the testcases.add_bug permission

Note

case_run_id can be None. In this case the bug will be attached only to the TestCase with specified case_id.

Example (doesn’t specify case_run_id):

>>> Bug.create({
    'case_id': 12345,
    'bug_id': 67890,
    'bug_system_id': 1,
    'summary': 'Testing TCMS',
    'description': 'Just foo and bar',
})
tcms.xmlrpc.api.bug.remove(query)[source]
XML-RPC Bug.remove(query)

Remove bugs from pre-existing TestCase or TestCaseRun object(s).

Parameters:query (dict) – Field lookups for tcms.testcases.models.Bug
Returns:None
Raises:PermissionDenied if missing the testcases.delete_bug permission

Example - removing bug from TestCase:

>>> Bug.remove({
    'case_id': 12345,
    'bug_id': 67890,
    'case_run__isnull': True
})

Example - removing bug from TestCaseRun (specify case_run_id):

>>> Bug.remove({
    'bug_id': 67890,
    'case_run_id': 99999,
})
tcms.xmlrpc.api.bug.filter(query)[source]
XML-RPC Bug.filter(query)

Get list of bugs that are associated with TestCase or a TestCaseRun.

Parameters:query (dict) – Field lookups for tcms.testcases.models.Bug
Returns:List of serialized tcms.testcases.models.Bug objects.

Get all bugs for particular TestCase:

>>> Bug.filter({'case': 123}) or Bug.filter({'case_id': 123})

Get all bugs for a particular TestCaseRun:

>>> Bug.filter({'case_run': 1234}) or Bug.filter({'case_run_id': 1234})