def test_post(self):
        view = BasicTestView.as_view()

        data = {'fake': 'data'}
        request = factory.post('/',data,format='json')

        with self.assertNumQueries(0):
            response = view(request).render()

        self.assertEqual(response.status_code, status.HTTP_405_METHOD_NOT_ALLOWED)
        self.assertEqual(response.data, {"detail": 'Method "POST" not allowed.'})
POST requests should throw a 405 Error
dataset/ETHPy150Open Axiologue/DjangoRestMultipleModels/drf_multiple_model/tests.py/TestMMViews.test_post