Skip to content

Commit

Permalink
initial checkin
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian Anderson committed Aug 21, 2012
1 parent bc6df57 commit acdce19
Show file tree
Hide file tree
Showing 38 changed files with 1,454 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Changelog
=========

1.0 (xxxx-xx-xx)
----------------

- Created recipe with ZopeSkel
[""]
2 changes: 2 additions & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"", Author

2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
recursive-include getpaid *
global-exclude *pyc
7 changes: 7 additions & 0 deletions docs/HISTORY.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Changelog
=========

1.0dev (unreleased)
-------------------

- Initial release
52 changes: 52 additions & 0 deletions docs/INSTALL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
getpaid.pfgbuyableadapter Installation
--------------------------------------

To install getpaid.pfgbuyableadapter into the global Python environment (or a workingenv),
using a traditional Zope 2 instance, you can do this:

* When you're reading this you have probably already run
``easy_install getpaid.pfgbuyableadapter``. Find out how to install setuptools
(and EasyInstall) here:
http://peak.telecommunity.com/DevCenter/EasyInstall

* If you are using Zope 2.9 (not 2.10), get `pythonproducts`_ and install it
via::

python setup.py install --home /path/to/instance

into your Zope instance.

* Create a file called ``getpaid.pfgbuyableadapter-configure.zcml`` in the
``/path/to/instance/etc/package-includes`` directory. The file
should only contain this::

<include package="getpaid.pfgbuyableadapter" />

.. _pythonproducts: http://plone.org/products/pythonproducts


Alternatively, if you are using zc.buildout and the plone.recipe.zope2instance
recipe to manage your project, you can do this:

* Add ``getpaid.pfgbuyableadapter`` to the list of eggs to install, e.g.:

[buildout]
...
eggs =
...
getpaid.pfgbuyableadapter

* Tell the plone.recipe.zope2instance recipe to install a ZCML slug:

[instance]
recipe = plone.recipe.zope2instance
...
zcml =
getpaid.pfgbuyableadapter

* Re-run buildout, e.g. with:

$ ./bin/buildout

You can skip the ZCML slug if you are going to explicitly include the package
from another package's configure.zcml file.
339 changes: 339 additions & 0 deletions docs/LICENSE.GPL

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions docs/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
getpaid.pfgbuyableadapter is copyright

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston,
MA 02111-1307 USA.
229 changes: 229 additions & 0 deletions getpaid.pfgbuyableadapter.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
Metadata-Version: 1.0
Name: getpaid.pfgbuyableadapter
Version: 1.0.3
Summary: An adapter for PloneFormGen to allow forms to be purchased.
Home-page: http://svn.plone.org/svn/collective/
Author: UNKNOWN
Author-email: UNKNOWN
License: GPL
Description: .. contents::

.. Note!
-----
Update the following URLs to point to your:

- code repository
- bug tracker
- questions/comments feedback mail
(do not set a real mail, to avoid spams)

Or remove it if not used.

- Code repository: http://svn.somewhere.com/...
- Questions and comments to somemailing_list
- Report bugs at http://bug.somewhere.com/..


Change history
**************

Changelog
=========

1.0 (xxxx-xx-xx)
----------------

- Created recipe with ZopeSkel
[""]

Detailed Documentation
**********************

Introduction
============

This is a full-blown functional test. The emphasis here is on testing what
the user may input and see, and the system is largely tested as a black box.
We use PloneTestCase to set up this test as well, so we have a full Plone site
to play with. We *can* inspect the state of the portal, e.g. using
self.portal and self.folder, but it is often frowned upon since you are not
treating the system as a black box. Also, if you, for example, log in or set
roles using calls like self.setRoles(), these are not reflected in the test
browser, which runs as a separate session.

Being a doctest, we can tell a story here.

First, we must perform some setup. We use the testbrowser that is shipped
with Five, as this provides proper Zope 2 integration. Most of the
documentation, though, is in the underlying zope.testbrower package.

>>> from Products.Five.testbrowser import Browser
>>> browser = Browser()
>>> portal_url = self.portal.absolute_url()

The following is useful when writing and debugging testbrowser tests. It lets
us see all error messages in the error_log.

>>> self.portal.error_log._ignored_exceptions = ()

With that in place, we can go to the portal front page and log in. We will
do this using the default user from PloneTestCase:

>>> from Products.PloneTestCase.setup import portal_owner, default_password

Because add-on themes or products may remove or hide the login portlet, this test will use the login form that comes with plone.

>>> browser.open(portal_url + '/login_form')
>>> browser.getControl(name='__ac_name').value = portal_owner
>>> browser.getControl(name='__ac_password').value = default_password
>>> browser.getControl(name='submit').click()

Here, we set the value of the fields on the login form and then simulate a
submit click. We then ensure that we get the friendly logged-in message:

>>> "You are now logged in" in browser.contents
True

Finally, let's return to the front page of our site before continuing

>>> browser.open(portal_url)

-*- extra stuff goes here -*-
The Buyable Form Adapter content type
===============================

In this section we are tesing the Buyable Form Adapter content type by performing
basic operations like adding, updadating and deleting Buyable Form Adapter content
items.

Adding a new Buyable Form Adapter content item
--------------------------------

We use the 'Add new' menu to add a new content item.

>>> browser.getLink('Add new').click()

Then we select the type of item we want to add. In this case we select
'Buyable Form Adapter' and click the 'Add' button to get to the add form.

>>> browser.getControl('Buyable Form Adapter').click()
>>> browser.getControl(name='form.button.Add').click()
>>> 'Buyable Form Adapter' in browser.contents
True

Now we fill the form and submit it.

>>> browser.getControl(name='title').value = 'Buyable Form Adapter Sample'
>>> browser.getControl('Save').click()
>>> 'Changes saved' in browser.contents
True

And we are done! We added a new 'Buyable Form Adapter' content item to the portal.

Updating an existing Buyable Form Adapter content item
---------------------------------------

Let's click on the 'edit' tab and update the object attribute values.

>>> browser.getLink('Edit').click()
>>> browser.getControl(name='title').value = 'New Buyable Form Adapter Sample'
>>> browser.getControl('Save').click()

We check that the changes were applied.

>>> 'Changes saved' in browser.contents
True
>>> 'New Buyable Form Adapter Sample' in browser.contents
True

Removing a/an Buyable Form Adapter content item
--------------------------------

If we go to the home page, we can see a tab with the 'New Buyable Form Adapter
Sample' title in the global navigation tabs.

>>> browser.open(portal_url)
>>> 'New Buyable Form Adapter Sample' in browser.contents
True

Now we are going to delete the 'New Buyable Form Adapter Sample' object. First we
go to the contents tab and select the 'New Buyable Form Adapter Sample' for
deletion.

>>> browser.getLink('Contents').click()
>>> browser.getControl('New Buyable Form Adapter Sample').click()

We click on the 'Delete' button.

>>> browser.getControl('Delete').click()
>>> 'Item(s) deleted' in browser.contents
True

So, if we go back to the home page, there is no longer a 'New Buyable Form Adapter
Sample' tab.

>>> browser.open(portal_url)
>>> 'New Buyable Form Adapter Sample' in browser.contents
False

Adding a new Buyable Form Adapter content item as contributor
------------------------------------------------

Not only site managers are allowed to add Buyable Form Adapter content items, but
also site contributors.

Let's logout and then login as 'contributor', a portal member that has the
contributor role assigned.

>>> browser.getLink('Log out').click()
>>> browser.open(portal_url + '/login_form')
>>> browser.getControl(name='__ac_name').value = 'contributor'
>>> browser.getControl(name='__ac_password').value = default_password
>>> browser.getControl(name='submit').click()
>>> browser.open(portal_url)

We use the 'Add new' menu to add a new content item.

>>> browser.getLink('Add new').click()

We select 'Buyable Form Adapter' and click the 'Add' button to get to the add form.

>>> browser.getControl('Buyable Form Adapter').click()
>>> browser.getControl(name='form.button.Add').click()
>>> 'Buyable Form Adapter' in browser.contents
True

Now we fill the form and submit it.

>>> browser.getControl(name='title').value = 'Buyable Form Adapter Sample'
>>> browser.getControl('Save').click()
>>> 'Changes saved' in browser.contents
True

Done! We added a new Buyable Form Adapter content item logged in as contributor.

Finally, let's login back as manager.

>>> browser.getLink('Log out').click()
>>> browser.open(portal_url + '/login_form')
>>> browser.getControl(name='__ac_name').value = portal_owner
>>> browser.getControl(name='__ac_password').value = default_password
>>> browser.getControl(name='submit').click()
>>> browser.open(portal_url)




Contributors
************

"", Author


Download
********

Platform: UNKNOWN
Classifier: Framework :: Plone
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
44 changes: 44 additions & 0 deletions getpaid.pfgbuyableadapter.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
CHANGES.txt
CONTRIBUTORS.txt
MANIFEST.in
README.txt
setup.cfg
setup.py
docs/HISTORY.txt
docs/INSTALL.txt
docs/LICENSE.GPL
docs/LICENSE.txt
getpaid/__init__.py
getpaid.pfgbuyableadapter.egg-info/PKG-INFO
getpaid.pfgbuyableadapter.egg-info/SOURCES.txt
getpaid.pfgbuyableadapter.egg-info/dependency_links.txt
getpaid.pfgbuyableadapter.egg-info/entry_points.txt
getpaid.pfgbuyableadapter.egg-info/namespace_packages.txt
getpaid.pfgbuyableadapter.egg-info/not-zip-safe
getpaid.pfgbuyableadapter.egg-info/paster_plugins.txt
getpaid.pfgbuyableadapter.egg-info/requires.txt
getpaid.pfgbuyableadapter.egg-info/top_level.txt
getpaid/pfgbuyableadapter/README.txt
getpaid/pfgbuyableadapter/__init__.py
getpaid/pfgbuyableadapter/config.py
getpaid/pfgbuyableadapter/configure.zcml
getpaid/pfgbuyableadapter/subscriber.py
getpaid/pfgbuyableadapter/browser/__init__.py
getpaid/pfgbuyableadapter/browser/configure.zcml
getpaid/pfgbuyableadapter/content/__init__.py
getpaid/pfgbuyableadapter/content/buyableformadapter.py
getpaid/pfgbuyableadapter/content/configure.zcml
getpaid/pfgbuyableadapter/interfaces/__init__.py
getpaid/pfgbuyableadapter/interfaces/buyableformadapter.py
getpaid/pfgbuyableadapter/portlets/__init__.py
getpaid/pfgbuyableadapter/portlets/configure.zcml
getpaid/pfgbuyableadapter/profiles/default/factorytool.xml
getpaid/pfgbuyableadapter/profiles/default/metadata.xml
getpaid/pfgbuyableadapter/profiles/default/portlets.xml
getpaid/pfgbuyableadapter/profiles/default/rolemap.xml
getpaid/pfgbuyableadapter/profiles/default/types.xml
getpaid/pfgbuyableadapter/profiles/default/types/Buyable_Form_Adapter.xml
getpaid/pfgbuyableadapter/profiles/default/types/FormFolder.xml
getpaid/pfgbuyableadapter/tests/__init__.py
getpaid/pfgbuyableadapter/tests/base.py
getpaid/pfgbuyableadapter/tests/test_doctest.py
1 change: 1 addition & 0 deletions getpaid.pfgbuyableadapter.egg-info/dependency_links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

5 changes: 5 additions & 0 deletions getpaid.pfgbuyableadapter.egg-info/entry_points.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

# -*- entry_points -*-
[z3c.autoinclude.plugin]
target = plone

1 change: 1 addition & 0 deletions getpaid.pfgbuyableadapter.egg-info/namespace_packages.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
getpaid
1 change: 1 addition & 0 deletions getpaid.pfgbuyableadapter.egg-info/not-zip-safe
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions getpaid.pfgbuyableadapter.egg-info/paster_plugins.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ZopeSkel
7 changes: 7 additions & 0 deletions getpaid.pfgbuyableadapter.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
setuptools
Products.PloneFormGen
Products.PloneGetPaid
mysql-python

[tests]
zope.testing
1 change: 1 addition & 0 deletions getpaid.pfgbuyableadapter.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
getpaid
Loading

0 comments on commit acdce19

Please sign in to comment.