From 75d0b325ac16b05bdc22591a7532c5543ffe26d2 Mon Sep 17 00:00:00 2001 From: Loic Teixeira Date: Mon, 3 Apr 2017 17:48:00 +1200 Subject: [PATCH] Add wagtail_hooks tests --- tests/test_wagtail_hooks.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/test_wagtail_hooks.py b/tests/test_wagtail_hooks.py index 717fce9..631dc06 100644 --- a/tests/test_wagtail_hooks.py +++ b/tests/test_wagtail_hooks.py @@ -2,6 +2,8 @@ import unittest +from wagtail.wagtailcore.hooks import get_hooks + from wagtaildraftail.wagtail_hooks import draftail_editor_css, draftail_editor_js @@ -10,6 +12,14 @@ def test_editor_css(self): self.assertEqual( draftail_editor_css(), '') + def test_insert_editor_css_hook(self): + hooks = get_hooks('insert_editor_css') + self.assertIn(draftail_editor_css, hooks, 'Editor CSS should be inserted automatically.') + def test_editor_js(self): self.assertEqual( draftail_editor_js(), '') + + def test_insert_editor_js(self): + hooks = get_hooks('insert_editor_js') + self.assertIn(draftail_editor_js, hooks, 'Editor JS should be inserted automatically.')