tcms.testcases.views module

class tcms.testcases.views.SimpleTestCaseView(**kwargs)[source]

Bases: django.views.generic.base.TemplateView

Simple read-only TestCase View used in TestPlan page

case_id = None
get(request, case_id)[source]
review_mode = None
template_name = 'case/get_details.html'
class tcms.testcases.views.TestCaseCaseRunDetailPanelView(**kwargs)[source]

Bases: django.views.generic.base.TemplateView

Display case run detail in run page

case_id = None
case_text_version = None
caserun_id = None
get(request, case_id)[source]
template_name = 'case/get_details_case_run.html'
class tcms.testcases.views.TestCaseCaseRunListPaneView(**kwargs)[source]

Bases: django.views.generic.base.TemplateView

Display case runs list when expand a plan from case page

case_id = None
get(request, case_id)[source]
plan_id = None
template_name = 'case/get_case_runs_by_plan.html'
class tcms.testcases.views.TestCaseSimpleCaseRunView(**kwargs)[source]

Bases: django.views.generic.base.TemplateView

Display caserun information in Case Runs tab in case page

This view only shows notes, comments and logs simply. So, call it simple.

caserun_id = None
get(request, case_id)[source]
template_name = 'case/get_details_case_case_run.html'

Generate the TestCase list for the UI tabs in TestPlan page view.

POST Parameters: from_plan: Plan ID

– [number]: When the plan ID defined, it will build the case

page in plan.

tcms.testcases.views.attachment(request, case_id, template_name='case/attachment.html')[source]

Manage test case attachments

tcms.testcases.views.bug(request, case_id, template_name='case/get_bug.html')[source]

Process the bugs for cases

tcms.testcases.views.build_cases_search_form(request, populate=None, plan=None)[source]

Build search form preparing for quering TestCases

tcms.testcases.views.calculate_for_testcases(plan, testcases)[source]

Calculate extra data for TestCases

Attach TestCasePlan.sortkey,, and the number of bugs of each TestCase.

Arguments: - plan: the TestPlan containing searched TestCases. None means testcases

are not limited to a specific TestPlan.
  • testcases: a queryset of TestCases.
tcms.testcases.views.clone(request, template_name='case/clone.html')[source]

Clone one case or multiple case into other plan or plans

tcms.testcases.views.create_testcase(request, form, test_plan)[source]

Create testcase

tcms.testcases.views.edit(request, case_id, template_name='case/edit.html')[source]

Edit case detail

tcms.testcases.views.get(request, case_id)[source]

Get the case content


Get part or all TestCaseStatus according to template type


Get selected TestCases from client side

TestCases are selected in two cases. One is user selects part of displayed TestCases, where there should be at least one variable named case, whose value is the TestCase Id. Another one is user selects all TestCases based on previous filter criterias even through there are non-displayed ones. In this case, another variable selectAll appears in the REQUEST. Whatever its value is.

If neither variables mentioned exists, empty query result is returned.

Arguments: - request: REQUEST object.

tcms.testcases.views.get_tags_from_cases(case_ids, plan=None)[source]

Get all tags from test cases

@param cases: an iterable object containing test cases’ ids @type cases: list, tuple

@param plan: TestPlan object

@return: a list containing all found tags with id and name @rtype: list

tcms.testcases.views.get_testcaseplan_sortkey_pk_for_testcases(plan, tc_ids)[source]

Get each TestCase’ sortkey and related TestCasePlan’s pk


Group bugs using bug_id.

tcms.testcases.views.load_more_cases(request, template_name='plan/cases_rows.html')[source]

Loading more TestCases, template_name='case/edit.html')[source]

New testcase

tcms.testcases.views.paginate_testcases(request, testcases)[source]

Paginate queried TestCases

Arguments: - request: django’s HttpRequest from which to get pagination data - testcases: an object queryset representing already queried TestCases

Return value: return the queryset for chain call

tcms.testcases.views.plan(request, case_id)[source]

Add and remove plan in plan tab


Get TestPlan from REQUEST

This method relies on the existence of from_plan within REQUEST.

tcms.testcases.views.printable(request, template_name='case/printable.html')[source]

Create the printable copy for plan/case. Only CONFIRMED TestCases are printed when printing a TestPlan!

tcms.testcases.views.query_testcases_from_request(request, plan=None)[source]

Query TestCases according to criterias coming within REQUEST

Arguments: - request: the REQUEST object. - plan: instance of TestPlan to restrict only those TestCases belongs to

the TestPlan. Can be None. As you know, query from all TestCases.[source]

Shows the search form which uses JSON RPC to fetch the resuts

tcms.testcases.views.sort_queried_testcases(request, testcases)[source]

Sort querid TestCases according to sort key

Arguments: - request: REQUEST object - testcases: object of QuerySet containing queried TestCases

tcms.testcases.views.text_history(request, case_id, template_name='case/history.html')[source]

View test plan text history

tcms.testcases.views.update_case_email_settings(test_case, n_form)[source]

Update testcase’s email settings.

tcms.testcases.views.update_testcase(request, test_case, tc_form)[source]

Updating information of specific TestCase

This is called by views.edit internally. Don’t call this directly.

Arguments: - test_case: instance of a TestCase being updated - tc_form: instance of django.forms.Form, holding validated data.