Exemplo n.º 1
0
 def test_missing_editor_plugin_returns_none(self):
     features = FeatureRegistry()
     self.assertIsNone(
         features.get_editor_plugin('made_up_editor', 'blockquote')
     )
     self.assertIsNone(
         features.get_editor_plugin('hallo', 'made_up_feature')
     )
Exemplo n.º 2
0
 def test_missing_editor_plugin_returns_none(self):
     features = FeatureRegistry()
     self.assertIsNone(
         features.get_editor_plugin('made_up_editor', 'blockquote')
     )
     self.assertIsNone(
         features.get_editor_plugin('hallo', 'made_up_feature')
     )
Exemplo n.º 3
0
 def test_register_rich_text_features_hook(self):
     # testapp/wagtail_hooks.py defines a 'blockquote' rich text feature with a hallo.js
     # plugin, via the register_rich_text_features hook; test that we can retrieve it here
     features = FeatureRegistry()
     quotation = features.get_editor_plugin('hallo', 'quotation')
     self.assertEqual(quotation.name, 'halloquotation')
Exemplo n.º 4
0
 def test_register_rich_text_features_hook(self):
     # testapp/wagtail_hooks.py defines a 'blockquote' rich text feature with a hallo.js
     # plugin, via the register_rich_text_features hook; test that we can retrieve it here
     features = FeatureRegistry()
     quotation = features.get_editor_plugin('hallo', 'quotation')
     self.assertEqual(quotation.name, 'halloquotation')
Exemplo n.º 5
0
 def test_missing_editor_plugin_returns_none(self):
     features = FeatureRegistry()
     self.assertIsNone(
         features.get_editor_plugin("made_up_editor", "blockquote"))
     self.assertIsNone(
         features.get_editor_plugin("draftail", "made_up_feature"))
Exemplo n.º 6
0
 def test_register_rich_text_features_hook(self):
     # testapp/wagtail_hooks.py defines a 'blockquote' rich text feature with a Draftail
     # plugin, via the register_rich_text_features hook; test that we can retrieve it here
     features = FeatureRegistry()
     quotation = features.get_editor_plugin("draftail", "quotation")
     self.assertEqual(quotation.js, ["testapp/js/draftail-quotation.js"])