tcms.testplans.views module

class tcms.testplans.views.Clone(**kwargs)[source]

Bases: django.views.generic.base.View

dispatch(request, *args, **kwargs)
http_method_names = ['post']
post(request)[source]
template_name = 'testplans/clone.html'
class tcms.testplans.views.Edit(**kwargs)[source]

Bases: django.views.generic.edit.UpdateView

dispatch(request, *args, **kwargs)
form_class

alias of tcms.testplans.forms.NewPlanForm

form_invalid(form)[source]

If the form is invalid, render the invalid form.

form_valid(form)[source]

If the form is valid, save the associated model.

get_context_data(**kwargs)[source]

Insert the form into the context dict.

get_form(form_class=None)[source]

Return an instance of the form to be used in this view.

model

alias of tcms.testplans.models.TestPlan

template_name = 'testplans/mutable.html'
class tcms.testplans.views.GetTestPlanRedirectView(**kwargs)[source]

Bases: django.views.generic.detail.DetailView

get(request, *args, **kwargs)[source]
http_method_names = ['get']
model

alias of tcms.testplans.models.TestPlan

class tcms.testplans.views.LinkCasesSearchView(**kwargs)[source]

Bases: django.views.generic.base.View

Search cases for linking to plan

get(request, pk)[source]
post(request, pk)[source]
template_name = 'plan/search_case.html'
class tcms.testplans.views.LinkCasesView(**kwargs)[source]

Bases: django.views.generic.base.View

Link cases to plan

post(request, pk)[source]
class tcms.testplans.views.NewTestPlanView(**kwargs)[source]

Bases: django.views.generic.edit.CreateView

dispatch(request, *args, **kwargs)
form_class

alias of tcms.testplans.forms.NewPlanForm

form_valid(form)[source]

If the form is valid, save the associated model.

get_context_data(**kwargs)[source]

Insert the form into the context dict.

get_form(form_class=None)[source]

Return an instance of the form to be used in this view.

get_form_kwargs()[source]

Return the keyword arguments for instantiating the form.

model

alias of tcms.testplans.models.TestPlan

template_name = 'testplans/mutable.html'
class tcms.testplans.views.ReorderCasesView(**kwargs)[source]

Bases: django.views.generic.base.View

Reorder cases

dispatch(request, *args, **kwargs)
http_method_names = ['post']
post(request, pk)[source]
class tcms.testplans.views.SearchTestPlanView(**kwargs)[source]

Bases: django.views.generic.base.TemplateView

get_context_data(**kwargs)[source]
template_name = 'testplans/search.html'
class tcms.testplans.views.TestPlanGetView(**kwargs)[source]

Bases: django.views.generic.detail.DetailView

get_context_data(**kwargs)[source]

Insert the single object into the context dict.

http_method_names = ['get']
model

alias of tcms.testplans.models.TestPlan

template_name = 'plan/get.html'
class tcms.testplans.views.UpdateParentView(**kwargs)[source]

Bases: django.views.generic.base.View

Updates TestPlan.parent. Called from the front-end.

dispatch(request, *args, **kwargs)
http_method_names = ['post']
post(request)[source]
tcms.testplans.views.calculate_stats_for_testplans(plans)[source]

Attach the number of cases and runs for each TestPlan

Parameters:plans (dict) – the queryset of TestPlans
Returns:A list of TestPlans, each of which is attached the statistics which is with prefix cal meaning calculation result.
Return type:list
tcms.testplans.views.get_number_of_children_plans(plan_ids)[source]

Get the number of children plans related to each plan

Parameters:plan_ids (list or tuple) – a tuple or list of TestPlans’ ids
Returns:a dict where key is plan_id and the value is the total count.
Return type:dict
tcms.testplans.views.get_number_of_plans_cases(plan_ids)[source]

Get the number of cases related to each plan

Parameters:plan_ids (list or tuple) – a tuple or list of TestPlans’ ids
Returns:a dict where key is plan_id and the value is the total count.
Return type:dict
tcms.testplans.views.get_number_of_plans_runs(plan_ids)[source]

Get the number of runs related to each plan

Parameters:plan_ids (list or tuple) – a tuple or list of TestPlans’ ids
Returns:a dict where key is plan_id and the value is the total count.
Return type:dict
tcms.testplans.views.printable(request)[source]

Create the printable copy for plan