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

Method test_put_root_view

tests/test_generics.py:126–135  ·  view source on GitHub ↗

PUT requests to ListCreateAPIView should not be allowed

(self)

Source from the content-addressed store, hash-verified

124 assert created.text == 'foobar'
125
126 def test_put_root_view(self):
127 """
128 PUT requests to ListCreateAPIView should not be allowed
129 """
130 data = {'text': 'foobar'}
131 request = factory.put('/', data, format='json')
132 with self.assertNumQueries(0):
133 response = self.view(request).render()
134 assert response.status_code == status.HTTP_405_METHOD_NOT_ALLOWED
135 assert response.data == {"detail": 'Method "PUT" not allowed.'}
136
137 def test_delete_root_view(self):
138 """

Callers

nothing calls this directly

Calls 3

putMethod · 0.45
renderMethod · 0.45
viewMethod · 0.45

Tested by

no test coverage detected