tcms.testcases.views module

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

Bases: django.views.generic.base.TemplateView

create_test_case(form, notify_form, test_plan)[source]

Create new test case

dispatch(request, *args, **kwargs)
get(request, *args, **kwargs)[source]
post(request, *args, **kwargs)[source]
template_name = 'testcases/mutable.html'
class tcms.testcases.views.SimpleTestCaseView(**kwargs)[source]

Bases: django.views.generic.base.TemplateView

Simple read-only TestCase View used in TestPlan page

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

Bases: django.views.generic.base.TemplateView

Display execution detail in run page

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

Manage test case attachments

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, TestCasePlan.pk, and the number of bugs of each TestCase.

Parameters:
  • 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.edit(request, case_id)[source]

Edit case detail

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

Get the case content

tcms.testcases.views.get_case_status(template_type)[source]

Get part or all TestCaseStatus according to template type

tcms.testcases.views.get_selected_testcases(request)[source]

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

tcms.testcases.views.group_case_bugs(bugs)[source]

Group bugs using bug_id.

tcms.testcases.views.list_all(request)[source]

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

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

Loading more TestCases

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_from_request_or_none(request)[source]

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

Parameters:
  • 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.
tcms.testcases.views.search(request)[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.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.