def __init__(self, *args, **kwargs): AppIndexDashboard.__init__(self, *args, **kwargs) # we disable title because its redundant with the model list module self.title = '' # append a model list module self.children.append(modules.ModelList( title=self.app_title, models=self.models, )) # append a recent actions module self.children.append(modules.RecentActions( column=2, title=_('Recent Actions'), include_list=self.get_app_content_types(), ))
def test_models(self): models = ['django.contrib.auth.models.User', 'django.contrib.auth.models.Group'] board = AppIndexDashboard('Auth', models) self.assertEqual(board.get_app_model_classes(), [User, Group])