Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to customise the CSS and JS in ZMI via Properties.
Requested by customer who uses TTW approach.
- Loading branch information
Showing
3 changed files
with
66 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,43 @@ | ||
import unittest | ||
import Testing.ZopeTestCase | ||
|
||
|
||
class TestNavigation(unittest.TestCase): | ||
class TestNavigation(Testing.ZopeTestCase.ZopeTestCase): | ||
|
||
def test_interfaces(self): | ||
from App.interfaces import INavigation | ||
from App.Management import Navigation | ||
from zope.interface.verify import verifyClass | ||
|
||
verifyClass(INavigation, Navigation) | ||
|
||
def test_Management__Navigation__manage_page_header__1(self): | ||
"""It respects `zmi_additional_css_paths` string property.""" | ||
self.folder.manage_addProperty( | ||
'zmi_additional_css_paths', '/foo/bar.css', 'string') | ||
self.assertIn('href="/foo/bar.css"', self.folder.manage_page_header()) | ||
|
||
def test_Management__Navigation__manage_page_header__2(self): | ||
"""It respects `zmi_additional_css_paths` ustring property.""" | ||
self.folder.manage_addProperty( | ||
'zmi_additional_css_paths', '/foo/bar.css', 'ustring') | ||
self.assertIn('href="/foo/bar.css"', self.folder.manage_page_header()) | ||
|
||
def test_Management__Navigation__manage_page_header__3(self): | ||
"""It respects `zmi_additional_css_paths` lines property.""" | ||
self.folder.manage_addProperty( | ||
'zmi_additional_css_paths', ['/foo/bar.css', '/baz.css'], 'lines') | ||
self.assertIn('href="/foo/bar.css"', self.folder.manage_page_header()) | ||
self.assertIn('href="/baz.css"', self.folder.manage_page_header()) | ||
|
||
def test_Management__Navigation__manage_page_header__4(self): | ||
"""It respects `zmi_additional_css_paths` ulines property.""" | ||
self.folder.manage_addProperty( | ||
'zmi_additional_css_paths', ['/foo/bar.css', '/baz.css'], 'lines') | ||
self.assertIn('href="/foo/bar.css"', self.folder.manage_page_header()) | ||
self.assertIn('href="/baz.css"', self.folder.manage_page_header()) | ||
|
||
def test_Management__Navigation__manage_page_header__5(self): | ||
"""It ignores an empty `zmi_additional_css_paths` property.""" | ||
self.folder.manage_addProperty( | ||
'zmi_additional_css_paths', '', 'string') | ||
self.assertNotIn('href=""', self.folder.manage_page_header()) |