• 
      

    Fix order-dependent admin sidebar manage-group cache tests.

    Review Request #15179 — Created July 21, 2026 and submitted — Latest diff uploaded

    Information

    Review Board
    release-9.x

    Reviewers

    Rendering any admin page stamps the sidebar's managed-models set onto
    the registered AdminManageNavGroupAction singleton (inside
    AdminSidebarManageActionGroupRenderer._get_sidebar_state()),
    and that instance attribute survived across tests. Once any earlier test
    rendered admin chrome, the "unmanaged" cache tests saw User as managed,
    the post_save/post_delete handlers invalidated the cache, and the tests
    failed.

    The test class now clears the stamped state from the registered action
    in setUp(), and _patch_managed_models() patches the registered
    instance instead of the class, which the instance attribute would
    otherwise shadow.

    Ran unit tests in random order.

    Commits

    Files