tests.py 文件源码

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

项目:2017.2-SiGI-Op_API 作者: fga-gpp-mds 项目源码 文件源码
def test_wrong_tubeloose_view_set(self):
        request = APIRequestFactory().get("")
        cabletype = CableStretchType.objects.create(description="random")
        cable_stretch_test = CableStretch.objects.create(length=1,
                                                         manufacturing_year=2012,
                                                         cod=1,
                                                         infrastructure="random",
                                                         owner="random",
                                                         fabricant='Potato Bread',
                                                         cable_stretch_type=cabletype,
                                                         access=False,
                                                         creation_date="2017-10-12",
                                                         updated_date="2017-10-12")
        tubeloose_detail = TubelooseListViewSet.as_view(actions={'get':'retrieve'})
        tubeloose_test = Tubeloose.objects.create(number=1010,
                                                  stretch_id=cable_stretch_test)
        primary_key = tubeloose_test.pk
        tubeloose_test.delete()
        response = tubeloose_detail(request, pk=primary_key)
        self.assertEqual(response.status_code, 404)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号