def test_update_cases_category(self):
self.client.login(username=self.tester.username, password='password')
post_data = {
'from_plan': self.plan.pk,
'product': self.product.pk,
'case': [self.case_1.pk, self.case_3.pk],
'a': 'update',
'o_category': self.case_cat_full_auto.pk,
}
response = self.client.post(self.case_category_url, post_data)
self.assertJSONEqual(
str(response.content, encoding=settings.DEFAULT_CHARSET),
{'rc': 0, 'response': 'ok', 'errors_list': []})
for pk in (self.case_1.pk, self.case_3.pk):
case = TestCase.objects.get(pk=pk)
self.assertEqual(self.case_cat_full_auto, case.category)
评论列表
文章目录