Skip to content

Commit

Permalink
Drop test dependency on zope.app.zcmlfiles and zope.app.server.
Browse files Browse the repository at this point in the history
This change reduces the test dependencies from 104 to 63.

These changes where copied from the old Python 3 branch:
https://github.com/zopefoundation/z3c.etestbrowser/compare/py3

Thank you @mgedmin for this branch.
  • Loading branch information
Michael Howitz committed Feb 27, 2019
1 parent 79466a5 commit ea19b83
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 35 deletions.
19 changes: 16 additions & 3 deletions setup.py
Expand Up @@ -23,11 +23,24 @@ def read(*rnames):


test_requires = [
'zope.testrunner',
'zope.annotation',
'zope.app.appsetup',
'zope.app.publication',
'zope.app.wsgi[testlayer] >= 4.0dev',
'zope.app.zcmlfiles',
'zope.app.server',
'zope.authentication',
'zope.browserpage',
'zope.component',
'zope.container',
'zope.location',
'zope.principalregistry',
'zope.publisher',
'zope.security',
'zope.securitypolicy',
'zope.site',
'zope.testbrowser[test]',
'zope.testing',
'zope.testrunner',
'zope.traversing',
]

setup(name='z3c.etestbrowser',
Expand Down
5 changes: 2 additions & 3 deletions src/z3c/etestbrowser/README.txt
@@ -1,9 +1,8 @@
Extended testbrowser
--------------------

This package provides some extensions to Zope 3's testbrowser. It is intended
for extensions that have dependencies that we do not want to rely on in the
Zope 3 core e.g. lxml.
This package provides some extensions to ``zope.testbrowser``. These are not
included in the core because they have extra dependencies, such as ``lxml``.


Requirements
Expand Down
85 changes: 85 additions & 0 deletions src/z3c/etestbrowser/fake_index.pt
@@ -0,0 +1,85 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Z3: </title>
<style type="text/css" media="all">@import url(http://localhost/@@/zope3_tablelayout.css);</style>
</head>
<body>
<!-- a copy of the standard zope 3 container view -->
<table id="layout" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" id="top">
<div id="global">
<div id="userDetails">
User:
Fallback unauthenticated principal
<a href="@@login.html?nextURL=http%3A//localhost/%40%40index.html">[Login]</a>
</div>
<a href="http://localhost/@@SelectedManagementView.html" name="top"><img src="http://localhost/@@/zope3logo.gif" /></a>
</div>
</td>
</tr>
<tr>
<td colspan="2">
<div id="breadcrumbs">
Location:&nbsp;<a href="http://localhost/@@SelectedManagementView.html">[top]</a>
/
</div>
</td>
</tr>
<tr>
<td id="navigation">
<div id="navigators">
<!-- Navigation tree box -->
<!-- Ugly is better than lobotomized. -->
<div class="box" id="navigationTree">
<h4>Navigation</h4>
<div xmlns="http://www.zope.org/zope3xmltree"
id="navtreecontents" class="body"
onclick="treeclicked(event);">Loading...
</div>
</div>
</div>
</td>
<td id="content">
<div id="workspace">
<!-- OnlineHelp with popup support -->
<!-- note, we reverse the actions list 'cos they're packed to the
screen from the right -->
<div id="viewspace">
<div id="message">
</div>
<div id="body">
<div>
<table id="sortable" class="listing"
summary="Content listing" cellpadding="2"
cellspacing="0">
<thead>
<tr>
<th>&nbsp;</th>
<th>Name</th>
<th>Title</th>
<th>Created</th>
<th>Modified</th>
</tr>
</thead>
</table>
</div>
</div>
<div id="context_information">
<div id="helpers">
</div>
</div>
<div class="spacer">
&nbsp;
</div>
</div>
</div>
<div id="footer" />
<div id="logger" />
</td>
</tr>
</table>
</body>
</html>
82 changes: 53 additions & 29 deletions src/z3c/etestbrowser/ftesting.zcml
@@ -1,47 +1,71 @@
<configure xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser"
i18n_domain="zope">
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser"
i18n_domain="zope">

<include package="zope.app.zcmlfiles" file="meta.zcml"/>
<include package="zope.app.zcmlfiles" />
<include package="zope.component" file="meta.zcml" />
<include package="zope.security" file="meta.zcml" />
<include package="zope.publisher" file="meta.zcml" />
<include package="zope.principalregistry" file="meta.zcml" />
<include package="zope.browserpage" file="meta.zcml" />
<include package="zope.app.publication" file="meta.zcml" />

<!-- Include Zope dependencies here -->
<include package="zope.publisher"/>
<include package="zope.traversing"/>
<include package="zope.traversing.browser"/>
<include package="zope.app.server"/>
<include package="zope.app.appsetup" />
<include package="zope.app.publication" />
<include package="zope.annotation" />
<include package="zope.authentication" />
<include package="zope.component" />
<include package="zope.container" />
<include package="zope.location" />
<include package="zope.principalregistry" />
<include package="zope.publisher" />
<include package="zope.security" />
<include package="zope.site" />
<include package="zope.traversing" />
<include package="zope.traversing.browser" />

<include package="zope.securitypolicy" file="meta.zcml"/>
<include package="zope.securitypolicy" />

<securityPolicy
component="zope.securitypolicy.zopepolicy.ZopeSecurityPolicy" />

<role id="zope.Anonymous" title="Everybody"
description="All users have this role implicitly" />
<role
id="zope.Anonymous" title="Everybody"
description="All users have this role implicitly" />

<grant permission="zope.View"
role="zope.Anonymous" />
<grant
permission="zope.View"
role="zope.Anonymous" />

<browser:defaultView name="index.html" />

<browser:page
name="index.html"
for="*"
template="fake_index.pt"
permission="zope.View"
/>

<browser:page
name="lxml.html"
for="*"
template="lxml.pt"
permission="zope.View"
/>
name="lxml.html"
for="*"
template="lxml.pt"
permission="zope.View"
/>

<browser:page
name="funny.html"
for="*"
template="funny.pt"
permission="zope.View"
/>
name="funny.html"
for="*"
template="funny.pt"
permission="zope.View"
/>

<browser:page
name="empty.html"
for="*"
template="empty.pt"
permission="zope.View"
/>
name="empty.html"
for="*"
template="empty.pt"
permission="zope.View"
/>

</configure>

0 comments on commit ea19b83

Please sign in to comment.