MCPcopy Index your code
hub / github.com/encode/django-rest-framework / test_delete_root_view

Method test_delete_root_view

tests/test_generics.py:137–145  ·  view source on GitHub ↗

DELETE requests to ListCreateAPIView should not be allowed

(self)

Source from the content-addressed store, hash-verified

135 assert response.data == {"detail": 'Method "PUT" not allowed.'}
136
137 def test_delete_root_view(self):
138 """
139 DELETE requests to ListCreateAPIView should not be allowed
140 """
141 request = factory.delete('/')
142 with self.assertNumQueries(0):
143 response = self.view(request).render()
144 assert response.status_code == status.HTTP_405_METHOD_NOT_ALLOWED
145 assert response.data == {"detail": 'Method "DELETE" not allowed.'}
146
147 def test_post_cannot_set_id(self):
148 """

Callers

nothing calls this directly

Calls 3

deleteMethod · 0.45
renderMethod · 0.45
viewMethod · 0.45

Tested by

no test coverage detected