@moviedo this is not going to work for you because the exception happens before the assignment to self.response takes place. If an exception is being thrown then you need to catch it in your view and return a response with your error and a 400 status code. You shouldn’t have to wrap it in the test.

assert_greater_equal is also not a good idea to use for such checks, because you want to test explicitly for “method not allowed”, otherwise if anything else goes wrong in your view you will accidentally allow the test to pass