[FIX,TEST,INTERNAL] Fixing bug in app_tests.py in case of errors.