The assertion will raise an AssertionError and you'll get a stack trace when you browse a site using the middleware, unless i'm missing something.