Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into fix-setBody-tuple
- Loading branch information
Showing
16 changed files
with
436 additions
and
54 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,5 @@ | |
/var/ | ||
coverage.xml | ||
pip-selfcheck.json | ||
Pipfile | ||
Pipfile.lock |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
ZServer==4.0b1 ; python_version < '3.0' |
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 |
---|---|---|
@@ -0,0 +1,81 @@ | ||
Installing Zope via ``pipenv`` | ||
============================== | ||
|
||
.. highlight:: bash | ||
|
||
This document describes how to install Zope via ``pipenv``. Python 3 only. | ||
|
||
Please note, that the support for Pipenv is considered experimental. | ||
|
||
Also, currently there is no support to update the Zope installation via ``pipenv``. | ||
|
||
|
||
Create a Virtual Environment | ||
---------------------------- | ||
|
||
.. code-block:: sh | ||
|
||
$ python3.6 -m venv zope | ||
$ cd zope | ||
|
||
|
||
Install pipenv | ||
-------------- | ||
|
||
.. code-block:: sh | ||
|
||
$ bin/pip install pipenv | ||
|
||
|
||
Install the Zope Software Packages | ||
---------------------------------- | ||
|
||
Look for the release you want to install on | ||
https://zopefoundation.github.io/Zope/. Than use the specific | ||
version of ``requirements-full.txt`` in the URL, replacing 4.0b4 in the example below. | ||
(Remove the --pre option for final releases.) | ||
|
||
.. code-block:: sh | ||
|
||
$ bin/pipenv install -r https://zopefoundation.github.io/Zope/releases/4.0b4/requirements-full.txt --pre | ||
... | ||
Successfully installed ... | ||
|
||
|
||
Creating a Zope instance | ||
------------------------ | ||
|
||
Once you've installed Zope, you will need to create an "instance | ||
home". This is a directory that contains configuration and data for a | ||
Zope server process. The instance home is created using the | ||
``mkwsgiinstance`` script: | ||
|
||
.. code-block:: sh | ||
|
||
$ bin/pipenv run mkwsgiinstance -d . | ||
|
||
You will be asked to provide a user name and password for an | ||
administrator's account during ``mkwsgiinstance``. To see the available | ||
command-line options, run the script with the ``--help`` option: | ||
|
||
.. code-block:: sh | ||
|
||
$ bin/pipenv run mkwsgiinstance --help | ||
|
||
The `-d .` specifies the directory to create the instance home in. | ||
If you follow the example and choose the current directory, you'll | ||
find the instances files in the subdirectories of the ``virtualenv``: | ||
|
||
- ``etc/`` will hold the configuration files. | ||
- ``var/`` will hold the database files. | ||
|
||
|
||
Starting your created instance | ||
------------------------------ | ||
|
||
To start your newly created instance, run the provided runwsgi script | ||
with the generated configuration: | ||
|
||
.. code-block:: sh | ||
|
||
$ bin/pipenv run runwsgi etc/zope.ini |
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
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 |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# -*- coding: utf-8 -*- | ||
import codecs | ||
import Testing.ZopeTestCase | ||
import Testing.testbrowser | ||
import Zope2.App | ||
|
||
|
||
class SortingTests(Testing.ZopeTestCase.FunctionalTestCase): | ||
"""Browser testing ..Image.File""" | ||
|
||
def setUp(self): | ||
super(SortingTests, self).setUp() | ||
|
||
Zope2.App.zcml.load_site(force=True) | ||
|
||
uf = self.app.acl_users | ||
uf.userFolderAddUser('manager', 'manager_pass', ['Manager'], []) | ||
|
||
self.app.manage_addFolder('sortingTest') | ||
self.app.manage_addOrderedFolder('sortingTestOrdered') | ||
for folder in [self.app.sortingTest, self.app.sortingTestOrdered]: | ||
folder.manage_addFile('File2') | ||
folder.manage_addFile('File1') | ||
folder.File1.update_data(u'hällo'.encode('utf-8')) | ||
|
||
self.browser = Testing.testbrowser.Browser() | ||
self.browser.addHeader( | ||
'Authorization', | ||
'basic {}'.format(codecs.encode( | ||
b'manager:manager_pass', 'base64').decode())) | ||
|
||
def check_order(self, expect_1_before_2): | ||
found_1_before_2 = ( | ||
self.browser.contents.find('File2') > | ||
self.browser.contents.find('File1') | ||
) | ||
self.assertEqual(found_1_before_2, expect_1_before_2) | ||
|
||
def test_sortby(self): | ||
base_url = 'http://localhost/sortingTest/manage_main?skey=%s&rkey=%s' | ||
|
||
self.browser.open(base_url % ('id', 'asc')) | ||
self.check_order(expect_1_before_2=True) | ||
|
||
self.browser.open(base_url % ('id', 'desc')) | ||
self.check_order(expect_1_before_2=False) | ||
|
||
self.browser.open(base_url % ('get_size', 'asc')) | ||
self.check_order(expect_1_before_2=False) | ||
|
||
self.browser.open(base_url % ('get_size', 'desc')) | ||
self.check_order(expect_1_before_2=True) | ||
|
||
def test_sortby_ordered(self): | ||
base_url = 'http://localhost/sortingTestOrdered/manage_main?' | ||
|
||
self.browser.open(base_url) | ||
self.check_order(expect_1_before_2=False) | ||
|
||
self.browser.open(base_url + 'rkey=desc') | ||
self.check_order(expect_1_before_2=True) | ||
|
||
self.browser.open(base_url + 'skey=id&rkey=asc') | ||
self.check_order(expect_1_before_2=True) | ||
|
||
self.browser.open(base_url + 'skey=id&rkey=desc') | ||
self.check_order(expect_1_before_2=False) |
Oops, something went wrong.