Example #1
0
 def test_get_panel_definitions_no_panels(self):
     """
     Check that get_panel_definitions returns the panels set on the model
     when no panels are set on the InlinePanel
     """
     inline_panel = InlinePanel(self.mock_model, 'formset')(
         instance=self.fake_instance,
         form=self.fake_field)
     result = inline_panel.get_panel_definitions()
     self.assertEqual(result[0].name, 'mock panel')
Example #2
0
 def test_get_panel_definitions_no_panels(self):
     """
     Check that get_panel_definitions returns the panels set on the model
     when no panels are set on the InlinePanel
     """
     inline_panel = InlinePanel(self.mock_model,
                                'formset')(instance=self.fake_instance,
                                           form=self.fake_field)
     result = inline_panel.get_panel_definitions()
     self.assertEqual(result[0].name, 'mock panel')
Example #3
0
 def test_get_panel_definitions(self):
     """
     Check that get_panel_definitions returns the panels set on
     InlinePanel
     """
     other_mock_panel = MagicMock()
     other_mock_panel.name = 'other mock panel'
     inline_panel = InlinePanel(self.mock_model,
                                'formset',
                                panels=[other_mock_panel])(
         instance=self.fake_instance,
         form=self.fake_field)
     result = inline_panel.get_panel_definitions()
     self.assertEqual(result[0].name, 'other mock panel')
Example #4
0
 def test_get_panel_definitions(self):
     """
     Check that get_panel_definitions returns the panels set on
     InlinePanel
     """
     other_mock_panel = MagicMock()
     other_mock_panel.name = 'other mock panel'
     inline_panel = InlinePanel(self.mock_model,
                                'formset',
                                panels=[other_mock_panel
                                        ])(instance=self.fake_instance,
                                           form=self.fake_field)
     result = inline_panel.get_panel_definitions()
     self.assertEqual(result[0].name, 'other mock panel')