{ "info": { "author": "adam tang", "author_email": "yuejun.tang@gmail.com", "bugtrack_url": null, "classifiers": [ "Framework :: Plone", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)" ], "description": ".. contents::\r\n\r\n.. Note!\r\n -----\r\n Update the following URLs to point to your:\r\n\r\n - code repository\r\n - bug tracker\r\n - questions/comments feedback mail\r\n (do not set a real mail, to avoid spams)\r\n\r\n Or remove it if not used.\r\n\r\n- Code repository: http://svn.somewhere.com/...\r\n- Questions and comments http://plone.315ok.org/\r\n- Report bugs at http://plone.315ok.org/\r\n\r\n\nChange history\n**************\n\nChangelog\r\n=========\r\n\r\n1.0 (xxxx-xx-xx)\r\n----------------\r\n\r\n- Created recipe with ZopeSkel\r\n [adam tang]\r\n\nDetailed Documentation\n**********************\n\nIntroduction\r\n============\r\n\r\nThis is a full-blown functional test. The emphasis here is on testing what\r\nthe user may input and see, and the system is largely tested as a black box.\r\nWe use PloneTestCase to set up this test as well, so we have a full Plone site\r\nto play with. We *can* inspect the state of the portal, e.g. using \r\nself.portal and self.folder, but it is often frowned upon since you are not\r\ntreating the system as a black box. Also, if you, for example, log in or set\r\nroles using calls like self.setRoles(), these are not reflected in the test\r\nbrowser, which runs as a separate session.\r\n\r\nBeing a doctest, we can tell a story here.\r\n\r\nFirst, we must perform some setup. We use the testbrowser that is shipped\r\nwith Five, as this provides proper Zope 2 integration. Most of the \r\ndocumentation, though, is in the underlying zope.testbrower package.\r\n\r\n >>> from Products.Five.testbrowser import Browser\r\n >>> browser = Browser()\r\n >>> portal_url = self.portal.absolute_url()\r\n\r\nThe following is useful when writing and debugging testbrowser tests. It lets\r\nus see all error messages in the error_log.\r\n\r\n >>> self.portal.error_log._ignored_exceptions = ()\r\n\r\nWith that in place, we can go to the portal front page and log in. We will\r\ndo this using the default user from PloneTestCase:\r\n\r\n >>> from Products.PloneTestCase.setup import portal_owner, default_password\r\n\r\n >>> browser.open(portal_url)\r\n\r\nWe have the login portlet, so let's use that.\r\n\r\n >>> browser.getControl(name='__ac_name').value = portal_owner\r\n >>> browser.getControl(name='__ac_password').value = default_password\r\n >>> browser.getControl(name='submit').click()\r\n\r\nHere, we set the value of the fields on the login form and then simulate a\r\nsubmit click.\r\n\r\nWe then test that we are still on the portal front page:\r\n\r\n >>> browser.url == portal_url\r\n True\r\n\r\nAnd we ensure that we get the friendly logged-in message:\r\n\r\n >>> \"You are now logged in\" in browser.contents\r\n True\r\n\r\n\r\n-*- extra stuff goes here -*-\r\nThe goods_image content type\r\n===============================\r\n\r\nIn this section we are tesing the goods_image content type by performing\r\nbasic operations like adding, updadating and deleting goods_image content\r\nitems.\r\n\r\nAdding a new goods_image content item\r\n--------------------------------\r\n\r\nWe use the 'Add new' menu to add a new content item.\r\n\r\n >>> browser.getLink('Add new').click()\r\n\r\nThen we select the type of item we want to add. In this case we select\r\n'goods_image' and click the 'Add' button to get to the add form.\r\n\r\n >>> browser.getControl('goods_image').click()\r\n >>> browser.getControl(name='form.button.Add').click()\r\n >>> 'goods_image' in browser.contents\r\n True\r\n\r\nNow we fill the form and submit it.\r\n\r\n >>> browser.getControl(name='title').value = 'goods_image Sample'\r\n >>> browser.getControl('Save').click()\r\n >>> 'Changes saved' in browser.contents\r\n True\r\n\r\nAnd we are done! We added a new 'goods_image' content item to the portal.\r\n\r\nUpdating an existing goods_image content item\r\n---------------------------------------\r\n\r\nLet's click on the 'edit' tab and update the object attribute values.\r\n\r\n >>> browser.getLink('Edit').click()\r\n >>> browser.getControl(name='title').value = 'New goods_image Sample'\r\n >>> browser.getControl('Save').click()\r\n\r\nWe check that the changes were applied.\r\n\r\n >>> 'Changes saved' in browser.contents\r\n True\r\n >>> 'New goods_image Sample' in browser.contents\r\n True\r\n\r\nRemoving a/an goods_image content item\r\n--------------------------------\r\n\r\nIf we go to the home page, we can see a tab with the 'New goods_image\r\nSample' title in the global navigation tabs.\r\n\r\n >>> browser.open(portal_url)\r\n >>> 'New goods_image Sample' in browser.contents\r\n True\r\n\r\nNow we are going to delete the 'New goods_image Sample' object. First we\r\ngo to the contents tab and select the 'New goods_image Sample' for\r\ndeletion.\r\n\r\n >>> browser.getLink('Contents').click()\r\n >>> browser.getControl('New goods_image Sample').click()\r\n\r\nWe click on the 'Delete' button.\r\n\r\n >>> browser.getControl('Delete').click()\r\n >>> 'Item(s) deleted' in browser.contents\r\n True\r\n\r\nSo, if we go back to the home page, there is no longer a 'New goods_image\r\nSample' tab.\r\n\r\n >>> browser.open(portal_url)\r\n >>> 'New goods_image Sample' in browser.contents\r\n False\r\n\r\nAdding a new goods_image content item as contributor\r\n------------------------------------------------\r\n\r\nNot only site managers are allowed to add goods_image content items, but\r\nalso site contributors.\r\n\r\nLet's logout and then login as 'contributor', a portal member that has the\r\ncontributor role assigned.\r\n\r\n >>> browser.getLink('Log out').click()\r\n >>> browser.open(portal_url)\r\n >>> browser.getControl(name='__ac_name').value = 'contributor'\r\n >>> browser.getControl(name='__ac_password').value = default_password\r\n >>> browser.getControl(name='submit').click()\r\n >>> browser.open(portal_url)\r\n\r\nWe use the 'Add new' menu to add a new content item.\r\n\r\n >>> browser.getLink('Add new').click()\r\n\r\nWe select 'goods_image' and click the 'Add' button to get to the add form.\r\n\r\n >>> browser.getControl('goods_image').click()\r\n >>> browser.getControl(name='form.button.Add').click()\r\n >>> 'goods_image' in browser.contents\r\n True\r\n\r\nNow we fill the form and submit it.\r\n\r\n >>> browser.getControl(name='title').value = 'goods_image Sample'\r\n >>> browser.getControl('Save').click()\r\n >>> 'Changes saved' in browser.contents\r\n True\r\n\r\nDone! We added a new goods_image content item logged in as contributor.\r\n\r\nFinally, let's login back as manager.\r\n\r\n >>> browser.getLink('Log out').click()\r\n >>> browser.open(portal_url)\r\n >>> browser.getControl(name='__ac_name').value = portal_owner\r\n >>> browser.getControl(name='__ac_password').value = default_password\r\n >>> browser.getControl(name='submit').click()\r\n >>> browser.open(portal_url)\r\n\r\n\r\nThe store content type\r\n===============================\r\n\r\nIn this section we are tesing the store content type by performing\r\nbasic operations like adding, updadating and deleting store content\r\nitems.\r\n\r\nAdding a new store content item\r\n--------------------------------\r\n\r\nWe use the 'Add new' menu to add a new content item.\r\n\r\n >>> browser.getLink('Add new').click()\r\n\r\nThen we select the type of item we want to add. In this case we select\r\n'store' and click the 'Add' button to get to the add form.\r\n\r\n >>> browser.getControl('store').click()\r\n >>> browser.getControl(name='form.button.Add').click()\r\n >>> 'store' in browser.contents\r\n True\r\n\r\nNow we fill the form and submit it.\r\n\r\n >>> browser.getControl(name='title').value = 'store Sample'\r\n >>> browser.getControl('Save').click()\r\n >>> 'Changes saved' in browser.contents\r\n True\r\n\r\nAnd we are done! We added a new 'store' content item to the portal.\r\n\r\nUpdating an existing store content item\r\n---------------------------------------\r\n\r\nLet's click on the 'edit' tab and update the object attribute values.\r\n\r\n >>> browser.getLink('Edit').click()\r\n >>> browser.getControl(name='title').value = 'New store Sample'\r\n >>> browser.getControl('Save').click()\r\n\r\nWe check that the changes were applied.\r\n\r\n >>> 'Changes saved' in browser.contents\r\n True\r\n >>> 'New store Sample' in browser.contents\r\n True\r\n\r\nRemoving a/an store content item\r\n--------------------------------\r\n\r\nIf we go to the home page, we can see a tab with the 'New store\r\nSample' title in the global navigation tabs.\r\n\r\n >>> browser.open(portal_url)\r\n >>> 'New store Sample' in browser.contents\r\n True\r\n\r\nNow we are going to delete the 'New store Sample' object. First we\r\ngo to the contents tab and select the 'New store Sample' for\r\ndeletion.\r\n\r\n >>> browser.getLink('Contents').click()\r\n >>> browser.getControl('New store Sample').click()\r\n\r\nWe click on the 'Delete' button.\r\n\r\n >>> browser.getControl('Delete').click()\r\n >>> 'Item(s) deleted' in browser.contents\r\n True\r\n\r\nSo, if we go back to the home page, there is no longer a 'New store\r\nSample' tab.\r\n\r\n >>> browser.open(portal_url)\r\n >>> 'New store Sample' in browser.contents\r\n False\r\n\r\nAdding a new store content item as contributor\r\n------------------------------------------------\r\n\r\nNot only site managers are allowed to add store content items, but\r\nalso site contributors.\r\n\r\nLet's logout and then login as 'contributor', a portal member that has the\r\ncontributor role assigned.\r\n\r\n >>> browser.getLink('Log out').click()\r\n >>> browser.open(portal_url)\r\n >>> browser.getControl(name='__ac_name').value = 'contributor'\r\n >>> browser.getControl(name='__ac_password').value = default_password\r\n >>> browser.getControl(name='submit').click()\r\n >>> browser.open(portal_url)\r\n\r\nWe use the 'Add new' menu to add a new content item.\r\n\r\n >>> browser.getLink('Add new').click()\r\n\r\nWe select 'store' and click the 'Add' button to get to the add form.\r\n\r\n >>> browser.getControl('store').click()\r\n >>> browser.getControl(name='form.button.Add').click()\r\n >>> 'store' in browser.contents\r\n True\r\n\r\nNow we fill the form and submit it.\r\n\r\n >>> browser.getControl(name='title').value = 'store Sample'\r\n >>> browser.getControl('Save').click()\r\n >>> 'Changes saved' in browser.contents\r\n True\r\n\r\nDone! We added a new store content item logged in as contributor.\r\n\r\nFinally, let's login back as manager.\r\n\r\n >>> browser.getLink('Log out').click()\r\n >>> browser.open(portal_url)\r\n >>> browser.getControl(name='__ac_name').value = portal_owner\r\n >>> browser.getControl(name='__ac_password').value = default_password\r\n >>> browser.getControl(name='submit').click()\r\n >>> browser.open(portal_url)\r\n\r\n\r\n\r\n\nContributors\n************\n\nadam tang, Author\r\n\r\n\nDownload\n********", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://svn.plone.org/svn/plone/plone.example", "keywords": "ecommerce online store", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "my315ok.store", "package_url": "https://pypi.org/project/my315ok.store/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/my315ok.store/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://svn.plone.org/svn/plone/plone.example" }, "release_url": "https://pypi.org/project/my315ok.store/3.0/", "requires_dist": null, "requires_python": null, "summary": "a online store system", "version": "3.0" }, "last_serial": 795127, "releases": { "3.0": [ { "comment_text": "", "digests": { "md5": "a22d0ac3462667df5dc51c91f15702e1", "sha256": "6268e441f1de05d729cf853578b037c0faf021a03772df8dc5817f50f664d339" }, "downloads": -1, "filename": "my315ok.store-3.0.tar.gz", "has_sig": false, "md5_digest": "a22d0ac3462667df5dc51c91f15702e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 107209, "upload_time": "2011-09-09T09:26:31", "url": "https://files.pythonhosted.org/packages/e7/f8/6a65dd0c45b99c20b959c7bdd109e427258349597e0f71878fee5db9c292/my315ok.store-3.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a22d0ac3462667df5dc51c91f15702e1", "sha256": "6268e441f1de05d729cf853578b037c0faf021a03772df8dc5817f50f664d339" }, "downloads": -1, "filename": "my315ok.store-3.0.tar.gz", "has_sig": false, "md5_digest": "a22d0ac3462667df5dc51c91f15702e1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 107209, "upload_time": "2011-09-09T09:26:31", "url": "https://files.pythonhosted.org/packages/e7/f8/6a65dd0c45b99c20b959c7bdd109e427258349597e0f71878fee5db9c292/my315ok.store-3.0.tar.gz" } ] }