@@ -958,7 +958,7 @@ def hasPermission(s, p, classname=None, d=None, e=None, **kw):
958958 # roundup will report a missing token.
959959 cl .db .config ['WEB_CSRF_ENFORCE_TOKEN' ] = 'required'
960960 cl .inner_main ()
961- match_at = out [0 ].find (' <p>Csrf token is missing. </p>' )
961+ match_at = out [0 ].find (" <p>We can't validate your session (csrf failure). Re-enter any unsaved data and try again. </p>" )
962962 print ("result of subtest 6a:" , out [0 ], match_at )
963963 self .assertEqual (match_at , 33 )
964964 del (out [0 ])
@@ -971,7 +971,7 @@ def hasPermission(s, p, classname=None, d=None, e=None, **kw):
971971 cl .form = db_test_base .makeForm (form2 )
972972
973973 cl .inner_main ()
974- match_at = out [0 ].find ('Invalid csrf token found: booogus' )
974+ match_at = out [0 ].find ("We can't validate your session ( csrf failure). Re-enter any unsaved data and try again." )
975975 print ("result of subtest 7:" , out [0 ])
976976 self .assertEqual (match_at , 36 )
977977 del (out [0 ])
@@ -999,7 +999,7 @@ def hasPermission(s, p, classname=None, d=None, e=None, **kw):
999999 # try a replay attack
10001000 cl .inner_main ()
10011001 # This should fail as token was wiped by last run.
1002- match_at = out [0 ].find ('Invalid csrf token found: %s' % nonce )
1002+ match_at = out [0 ].find ("We can't validate your session ( csrf failure). Re-enter any unsaved data and try again." )
10031003 print ("replay of csrf after post use" , out [0 ])
10041004 print ("result of subtest 10:" , out [0 ])
10051005 self .assertEqual (match_at , 36 )
@@ -1030,7 +1030,7 @@ def hasPermission(s, p, classname=None, d=None, e=None, **kw):
10301030 cl .env .update ({'REQUEST_METHOD' : 'POST' })
10311031 print (cl .env )
10321032 cl .inner_main ()
1033- match_at = out [0 ].find ('Invalid csrf token found: %s' % nonce )
1033+ match_at = out [0 ].find ("We can't validate your session ( csrf failure). Re-enter any unsaved data and try again." )
10341034 print ("post failure after get" , out [0 ])
10351035 print ("result of subtest 13:" , out [0 ])
10361036 self .assertEqual (match_at , 36 )
0 commit comments