PUT requests to ListCreateAPIView should not be allowed
(self)
| 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 | """ |