def test_get_and_post(self):
        self._assert_simple(SimplePostView.as_view()(self.rf.get('/')))
        self._assert_simple(SimplePostView.as_view()(self.rf.post('/')))
        self.assertEqual(SimplePostView.as_view()(
            self.rf.get('/', REQUEST_METHOD='FAKE')
        ).status_code, 405)
Test a view which only allows both GET and POST.
dataset/ETHPy150Open django/django/tests/generic_views/test_base.py/ViewTest.test_get_and_post