Skip to content

Commit

Permalink
Clone TC: always keep default tester. Fixes #838
Browse files Browse the repository at this point in the history
when cloning test cases we'll always keep the value of
default_tester that was set on the source TC. This is the same
behavior that was introduced when cloning TPs + TCs, see
a9c7ccf
  • Loading branch information
atodorov committed Jul 24, 2019
1 parent ad1f93b commit 225a216
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 24 deletions.
14 changes: 0 additions & 14 deletions tcms/templates/case/clone.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,6 @@ <h2>{% trans "Clone TestCase(s) into" %} TP-{{ test_plan.pk }}: {{ test_plan.nam
<label class="strong title">{% trans "Case(s)" %}</label>
<div class="linotype">{{ clone_form.case }}</div>
</div>
<div class="listinfo">
<label class="strong title">{% trans "Clone Settings" %}</label>
<fieldset class="choose">
<legend class="">{% trans "Case Properties" %}</legend>
<ul class="ul-no-format">
<li>
{{ clone_form.maintain_case_orignal_default_tester }}
<span>
<label for="id_maintain_case_orignal_default_tester">{{ clone_form.maintain_case_orignal_default_tester.help_text }}</label>
</span>
</li>
</ul>
</fieldset>
</div>
<div class="submit-row">
<input type="hidden" name="from_plan" value="{{ test_plan.pk }}"/>
<input type="submit" name="submit" value="Clone" />
Expand Down
6 changes: 0 additions & 6 deletions tcms/testcases/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,12 +281,6 @@ class CloneCaseForm(forms.Form):
queryset=TestPlan.objects.all(),
widget=forms.CheckboxSelectMultiple()
)
maintain_case_orignal_default_tester = forms.BooleanField(
label='Keep original default tester',
help_text='Keep original default tester (Unchecking will make me as '
'default tester of the copied test case)',
required=False
)

def populate(self, case_ids):
self.fields['case'].queryset = TestCase.objects.filter(case_id__in=case_ids)
5 changes: 1 addition & 4 deletions tcms/testcases/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,9 +790,7 @@ def clone(request, template_name='case/clone.html'):
notes=tc_src.notes,
text=tc_src.text,
author=request.user,
default_tester=clone_form.cleaned_data[
'maintain_case_orignal_default_tester'] and
tc_src.author or request.user,
default_tester=tc_src.default_tester,
)

# apply tags as well
Expand Down Expand Up @@ -863,7 +861,6 @@ def clone(request, template_name='case/clone.html'):
# Initial the clone case form
clone_form = CloneCaseForm(initial={
'case': selected_cases,
'maintain_case_orignal_default_tester': False,
})
clone_form.populate(case_ids=selected_cases)

Expand Down

0 comments on commit 225a216

Please sign in to comment.