Esempio n. 1
0
 def test_inline_passed_returns_inline_templated(self):
     """
     Tests if an inline html is correctly generated when an inline is passed.
     """
     inline = self.view.context_data['tabs']['fields'][0]['entries'][1]
     self.assertEqual('inline', inline['type'])
     tag = render_tab_fieldsets_inlines(self.context, inline)
     self.assertIn('inline', tag)
Esempio n. 2
0
 def test_fieldset_passed_returns_fieldset_templated(self):
     """
     Tests if the fieldset html is correctly generated when a fieldset is passed
     """
     fieldset = self.view.context_data['tabs']['fields'][0]['entries'][0]
     self.assertEqual('fieldset', fieldset['type'])
     tag = render_tab_fieldsets_inlines(self.context, fieldset)
     self.assertIn('fieldset', tag)
Esempio n. 3
0
 def test_inline_passed_returns_inline_templated(self):
     """
     Tests if an inline html is correctly generated when an inline is passed.
     """
     inline = self.view.context_data['tabs']['fields'][0]['entries'][1]
     self.assertEqual('inline', inline['type'])
     tag = render_tab_fieldsets_inlines(self.context, inline)
     self.assertIn('inline', tag)
Esempio n. 4
0
 def test_fieldset_passed_returns_fieldset_templated(self):
     """
     Tests if the fieldset html is correctly generated when a fieldset is passed
     """
     fieldset = self.view.context_data['tabs']['fields'][0]['entries'][0]
     self.assertEqual('fieldset', fieldset['type'])
     tag = render_tab_fieldsets_inlines(self.context, fieldset)
     self.assertIn('fieldset', tag)
Esempio n. 5
0
 def test_wrong_inline_key_returns_nothing(self):
     """
     Tests if a worng inline naming returns nothing.
     """
     inline = self.view.context_data['tabs']['fields'][0]['entries'][1]
     self.assertEqual('inline', inline['type'])
     inline['name'] = 'Not exists'
     tag = render_tab_fieldsets_inlines(self.context, inline)
     self.assertEqual('', tag)
Esempio n. 6
0
 def test_wrong_inline_key_returns_nothing(self):
     """
     Tests if a worng inline naming returns nothing.
     """
     inline = self.view.context_data['tabs']['fields'][0]['entries'][1]
     self.assertEqual('inline', inline['type'])
     inline['name'] = 'Not exists'
     tag = render_tab_fieldsets_inlines(self.context, inline)
     self.assertEqual('', tag)