test_views.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:Kiwi 作者: kiwitcms 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号