• 
      

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

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

    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.

    Summary ID
    Fix order-dependent admin sidebar manage-group cache tests.
    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. Testing Done: Ran unit tests in random order.
    zmpykkxzlwspnvqkrrqmrxtpsmunzrwn
    chipx86
    1. Ship It!
    2. 
        
    david
    Review request changed
    Status:
    Completed
    Change Summary:
    Pushed to release-8.x (a4d694f)