def test_apiview_invalid_method(rf):
 view = UserAPIView.as_view()
 request = create_api_request(rf, 'post')
 response = view(request)
 assert (response.status_code == 405)
 request = create_api_request(rf, 'patch')
 response = view(request)
 assert (response.status_code == 405)

def test_apiview_invalid_method ( rf ) : view = UserAPIView . as_view ( ) request = create_api_request ( rf , 'post' ) response = view ( request ) assert ( response . status_code == 405 ) request = create_api_request ( rf , 'patch' ) response = view ( request ) assert ( response . status_code == 405 )
tests for invalid methods .