Changes between Initial Version and Version 1 of Ticket #29917, comment 8


Ignore:
Timestamp:
Nov 3, 2018, 10:17:01 AM (6 years ago)
Author:
Matthias Kestenholz

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #29917, comment 8

    initial v1  
    1212+
    1313+    def test_actions_mro(self):
    14 +        class MockRequest:
    15 +            pass
    16 +
    1714+        class AdminBase(admin.ModelAdmin):
    1815+            actions = ['custom_action']
     
    2522+
    2623+        ma = BandAdmin(Band, admin.AdminSite())
    27 +        mock_request = MockRequest()
    28 +        mock_request.GET = {}
    29 +        mock_request.user = self.superuser
    3024+        action_names = [a[1] for a in ma._get_base_actions()]
    3125+        self.assertEqual(action_names, ['delete_selected', 'custom_action'])
     
    4337}}}
    4438
    45 See how the `custom_action` is added twice, once by `AdminBase.actions` directly, and once by its inheritance in `BandAdmin`
     39Observe how the `custom_action` is added twice, once by `AdminBase.actions` directly, and once by its inheritance in `BandAdmin`
Back to Top