mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2026-08-19 01:15:04 -05:00
get_test_user() created secondary test clients via app.test_client() but never called setApp() on them, so any test using a second user crashed with 'NoneType has no attribute config' the first time it needed to fetch a CSRF token (44 errors in a full server-mode run). TestSqlEditorCloseRequiresAuth.setUp() logs out the shared class-level tester before asserting a CSRF token was harvested; when that assertion failed, unittest skipped tearDown() entirely (by design, tearDown only runs if setUp succeeds), leaving the tester logged out for the rest of the suite and cascading into 188 unrelated failures. Switched to addCleanup(), which always runs. Full server-mode regression: 2507 tests, was 232 failures/errors, now 2 (both isolated to this same test's own CSRF-harvest timing in full-suite order, unrelated to these two fixes).