def test_cable_stretch_view_set(self):
request = APIRequestFactory().get("")
cable_stretch_detail = CableStretchListViewSet.as_view(actions={'get':'retrieve'})
cabletype = CableStretchType.objects.create(description="random")
cable_stretch_test = CableStretch.objects.create(cod=1,
length=1,
manufacturing_year=2012,
infrastructure="random",
owner="random",
fabricant='Potato Bread',
cable_stretch_type=cabletype,
access=False,
creation_date="2017-10-12",
updated_date="2017-10-12")
response = cable_stretch_detail(request, pk=cable_stretch_test.pk)
self.assertEqual(response.status_code, 200)
评论列表
文章目录