add test case to reproduce the bug for #798

Here is the test case for #798.

It should broke in current Flask, and after #798 it won't.