Changes between Initial Version and Version 1 of Ticket #29917, comment 8
- Timestamp:
- Nov 3, 2018, 10:17:01 AM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #29917, comment 8
initial v1 12 12 + 13 13 + def test_actions_mro(self): 14 + class MockRequest:15 + pass16 +17 14 + class AdminBase(admin.ModelAdmin): 18 15 + actions = ['custom_action'] … … 25 22 + 26 23 + ma = BandAdmin(Band, admin.AdminSite()) 27 + mock_request = MockRequest()28 + mock_request.GET = {}29 + mock_request.user = self.superuser30 24 + action_names = [a[1] for a in ma._get_base_actions()] 31 25 + self.assertEqual(action_names, ['delete_selected', 'custom_action']) … … 43 37 }}} 44 38 45 See how the `custom_action` is added twice, once by `AdminBase.actions` directly, and once by its inheritance in `BandAdmin`39 Observe how the `custom_action` is added twice, once by `AdminBase.actions` directly, and once by its inheritance in `BandAdmin`