Skip to content

Commit

Permalink
Merge d502e06 into 5e98b2f
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Howitz committed May 2, 2022
2 parents 5e98b2f + d502e06 commit e7c1ae5
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 7 deletions.
5 changes: 4 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ Changelog

- Add support for Python 3.9

- change package structure to move package code into a ``src`` subfolder
- Change package structure to move package code into a ``src`` subfolder.

- Fix bug which prevented ZMI from rendering, when Products.ExternalEdit was
installed.


3.0.1 (2020-10-30)
Expand Down
4 changes: 0 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,4 @@
'Zope >= 4.3',
'six',
],
entry_points="""
[console_scripts]
zopeedit=Products.ExternalEditor.zopeedit:main
""",
)
2 changes: 1 addition & 1 deletion src/Products/ExternalEditor/ExternalEditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.class_init import InitializeClass
from Acquisition import aq_inner, aq_base, aq_parent, Implicit
from App.Common import rfc1123_date
from zope.datetime import rfc1123_date
from OFS import Image
from OFS.Lockable import wl_isLocked
from six.moves import urllib
Expand Down
25 changes: 25 additions & 0 deletions src/Products/ExternalEditor/tests/test_zmi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import Testing.testbrowser
import Testing.ZopeTestCase
import Zope2.App


class ZMITests(Testing.ZopeTestCase.FunctionalTestCase):
"""Testing the ZMI rendering."""

def setUp(self):
super(ZMITests, self).setUp()

Zope2.App.zcml.load_site(force=True)

uf = self.app.acl_users
uf.userFolderAddUser('manager', 'manager_pass', ['Manager'], [])
self.app.manage_addProduct['OFSP'].addDTMLMethod('meth')

def test_ZMI(self):
"""It renders a link to to external edit."""
browser = Testing.testbrowser.Browser()
browser.login('manager', 'manager_pass')
browser.open('http://localhost/manage_main')
link = browser.getLink(url='meth.zem')
self.assertEqual(link.attrs['title'], 'Edit using external editor')
self.assertEqual(link.url, 'http://localhost/externalEdit_/meth.zem')
2 changes: 1 addition & 1 deletion src/Products/ExternalEditor/zpt/main.zpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<form name="objectItems"
method="post"
tal:define="has_order_support python:getattr(here.aq_explicit, 'has_order_support', 0);
sm modules/AccessControl/SecurityManagement/getSecurityManager;
sm modules/AccessControl/getSecurityManager;
default_sort python: 'position' if has_order_support else 'id';
skey python:request.get('skey',default_sort);
rkey python:request.get('rkey','asc');
Expand Down

0 comments on commit e7c1ae5

Please sign in to comment.