mirror of
https://github.com/jazzband/django-admin2.git
synced 2026-03-16 22:20:24 +00:00
Added tests for pull-request #386
1. Custom views should be prepended to the 'views' list, otherwise they could be shadowed by views of the superclass. 2. Custom views should not be added to the superclass 'views' list. Instead a new list should be created and assigned to the class.
This commit is contained in:
parent
4c35c506a7
commit
606db2fe7a
1 changed files with 5 additions and 4 deletions
|
|
@ -53,10 +53,11 @@ class ModelAdminTest(TestCase):
|
|||
self.model_admin = MyModelAdmin
|
||||
|
||||
def test_views(self):
|
||||
self.assertIn(
|
||||
self.model_admin.my_view,
|
||||
self.model_admin.views
|
||||
)
|
||||
views = [self.model_admin.my_view] + ModelAdmin2.views
|
||||
self.assertListEqual(self.model_admin.views, views)
|
||||
|
||||
def test_views_not_same(self):
|
||||
self.assertIsNot(self.model_admin.views, ModelAdmin2.views)
|
||||
|
||||
def test_get_index_kwargs(self):
|
||||
admin_instance = ModelAdmin2(Thing, Admin2)
|
||||
|
|
|
|||
Loading…
Reference in a new issue