{ "info": { "author": "Adomas Paltanavicius", "author_email": "adomas.paltanavicius@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "License :: OSI Approved :: MIT License", "Topic :: Software Development :: Testing" ], "description": "-----\nAbout\n-----\n\n**homophony** provides ``zc.testbrowser`` integration for Django;\n``zc.testbrowser`` is a lot more robust than the default functional testing\nclient that comes with Django.\n\nSee the introduction_ to ``zc.testbrowser`` for a better understanding\nof how powerful it is.\n\n.. _introduction: http://pypi.python.org/pypi/zc.testbrowser/1.0a1\n\n\n---------------\nUsing homophony\n---------------\n\nFirst of all, you need to have **homophony** installed; for your convenience,\nrecent versions should be available from PyPI.\n\nLet's say you're working on an application called ``foobar``; the tests for\nthis application are located in ``foobar/tests.py``.\n\n\nUnit tests\n==========\n\nUse this as a starting point for ``foobar/tests.py``::\n\n from homophony import BrowserTestCase, Browser\n\n class FoobarTestCase(BrowserTestCase):\n\n def testHome(self):\n browser = Browser()\n browser.open('http://testserver')\n browser.getControl(name='first_name').value = 'Jim'\n browser.getForm().submit()\n self.assertEquals(browser.url, 'http://testserver/hello')\n self.assertEquals(browser.title, 'Hello Jim')\n\n\nBear in mind that implementing custom ``setUp`` and ``tearDown`` methods\nshould involve calling those defined in ``BrowserTestCase``.\n\n\nDoctests\n========\n\nIf you prefer doctests over unit tests (as we do!), use the following as a base\nfor ``foobar/tests.py``::\n\n from homophony import DocFileSuite\n\n def suite():\n return DocFileSuite('tests.txt')\n\n\nAnd here is an example ``foobar/tests.txt`` file::\n\n The website welcomes its visitors with a form:\n\n >>> browser = Browser()\n >>> browser.open('http://testserver')\n >>> browser.getControl(name='first_name').value = 'Jim'\n >>> browser.getForm().submit()\n\n When a name is given, it echoes back with an informal greeting:\n\n >>> browser.title\n 'Hello Jim'\n >>> print browser.contents\n \n ...\n

Hello Jim

\n ...\n\n And there is a link to go back:\n\n >>> browser.getLink('Go back').click()\n >>> browser.title\n 'Home'\n\n\nHelpers\n=======\n\nThere are some useful helpers on the browser class. You can run **XPath** queries\non HTML documents using ``queryHTML``, like this:\n\n >>> browser.queryHTML('//h1')\n

Hello Jim

\n\nWhen debugging tests, it is sometimes handy to open a browser at a particular\npoint in the test. You can accomplish that by invoking ``serve``:\n\n >>> browser.serve()\n\nThis command will start an HTTP server and open a web browser with live access\nto your application. Use Ctrl-C to stop the server and continue running tests.\n\nThere is a known issue that the mini-webserver does not serve static files, so\nyour browser may not be able to access Javascript or CSS used by your app.\n\nThe browser will persist cookies accross requests, so things like user sessions\nshould work.\n\n\nExample application\n===================\n\nThere is an example Django application in the source distribution. Let's\nrun the tests::\n\n wormhole:example admp$ ./manage.py test -v 2 website\n Creating test database...\n Creating table auth_permission\n Creating table auth_group\n Creating table auth_user\n Creating table auth_message\n Creating table django_content_type\n Creating table django_session\n Creating table django_site\n Installing index for auth.Permission model\n Installing index for auth.Message model\n ...\n testHome (example.website.tests.FoobarTestCase) ... ok\n Doctest: tests.txt ... ok\n\n ----------------------------------------------------------------------\n Ran 2 tests in 0.102s\n\n OK\n Destroying test database...\n\nThe ``-v 2`` parameter is there to get the list of tests printed, and is otherwise\nunnecessary.\n\nFor learning purposes, try to break the tests and witness the details in the\noutput of the test runner.\n\n\n-----------------\nHow does it work?\n-----------------\n\nCustom hooks are installed for ``urllib`` to pass all requests for\n``http://testserver`` to a subclass of ``WSGIHandler`` (which\nexposes Django applications through WSGI_). The real heavy lifting is\nperformed by ``wsgi_intercept``.\n\n.. _WSGI: http://www.wsgi.org/\n\n--------\nFeedback\n--------\n\nThere is a `home page `_ with\ninstructions on how to access the code repository.\n\nSend feedback and suggestions to team@shrubberysoft.com.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/shrubberysoft/homophony", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "homophony", "package_url": "https://pypi.org/project/homophony/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/homophony/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/shrubberysoft/homophony" }, "release_url": "https://pypi.org/project/homophony/0.1.7.1/", "requires_dist": null, "requires_python": null, "summary": "Django and zc.testbrowser integration", "version": "0.1.7.1" }, "last_serial": 1245460, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "609e4e4c0dc643d4ee1bee0b4288a12e", "sha256": "7a796d2c0994dc0da7978a511cf3eea09da8b5d51e646d41313124cf44768951" }, "downloads": -1, "filename": "homophony-0.1.2.tar.gz", "has_sig": false, "md5_digest": "609e4e4c0dc643d4ee1bee0b4288a12e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4790, "upload_time": "2009-09-19T03:36:38", "url": "https://files.pythonhosted.org/packages/34/a3/d6d3276914f8acbff78a51ba7ca922cccae907816e28d30431cd0d8f7a3c/homophony-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "2ba0432ef1cc63d68043d2ebdc3b9d37", "sha256": "98b9b202885bed5856b88a46ab3aee0e90b1fdefda3c36dcbe456e061d8eaca6" }, "downloads": -1, "filename": "homophony-0.1.3.tar.gz", "has_sig": false, "md5_digest": "2ba0432ef1cc63d68043d2ebdc3b9d37", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5384, "upload_time": "2009-10-09T14:05:49", "url": "https://files.pythonhosted.org/packages/39/41/188263d8d9d785a7a899ebf3336b7f3af25ed03c6600d9b1fae2a1ce57a1/homophony-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "f9a8fdc94453cf6111c212326983e721", "sha256": "e7e4c028e3e650b0cfc5af66cd0d55241a601b5f061912822644a94fd2daba12" }, "downloads": -1, "filename": "homophony-0.1.4.tar.gz", "has_sig": false, "md5_digest": "f9a8fdc94453cf6111c212326983e721", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5490, "upload_time": "2010-03-18T10:09:25", "url": "https://files.pythonhosted.org/packages/e6/d8/a4abdc2d64399bb239149183c924fd857e3ff3c16b220dbddb16f36f5e2a/homophony-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "c8ba500279b0a97977397cc9b47618dc", "sha256": "a5d7094d6a68499dfe12c47efcd00d7f8e6fd116de8e5025a2e8869d30708790" }, "downloads": -1, "filename": "homophony-0.1.5.tar.gz", "has_sig": false, "md5_digest": "c8ba500279b0a97977397cc9b47618dc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5487, "upload_time": "2010-03-18T10:35:56", "url": "https://files.pythonhosted.org/packages/26/9c/58ecf97772a78ddb8800240aec48514335948d32407da80838585e6d5df8/homophony-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "91ec3da593eff217f879c0b3e9c681f3", "sha256": "cb64844b906fcf9bb8d84dbadcddeb45fdbf8158bc68c869f7e31b9a642ce4b9" }, "downloads": -1, "filename": "homophony-0.1.6.tar.gz", "has_sig": false, "md5_digest": "91ec3da593eff217f879c0b3e9c681f3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5467, "upload_time": "2010-03-18T10:39:12", "url": "https://files.pythonhosted.org/packages/bf/82/14f38db8c570607f654f7edb1a21cfbd1997a241c0e1b1f91c267cddd955/homophony-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "f6e8e366c85ae278ccafb990d1eb018c", "sha256": "ce729aae06a899215552d9523814aa8bc42e6abf0d5a17ff07e2a2a9d9127570" }, "downloads": -1, "filename": "homophony-0.1.7.tar.gz", "has_sig": false, "md5_digest": "f6e8e366c85ae278ccafb990d1eb018c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5343, "upload_time": "2010-06-01T14:48:03", "url": "https://files.pythonhosted.org/packages/43/22/5a7dba9f81ec9aa5e2b0707bee901f1382d1cebde7eb4fd3f42fb9d322e4/homophony-0.1.7.tar.gz" } ], "0.1.7.1": [ { "comment_text": "", "digests": { "md5": "fcb61c712a8f002fe8ec277e1759e6bb", "sha256": "d38ce91a193224f6a2ebe8c7a3a7779bf781a60624ace1a4207aa5b059238db9" }, "downloads": -1, "filename": "homophony-0.1.7.1.tar.gz", "has_sig": false, "md5_digest": "fcb61c712a8f002fe8ec277e1759e6bb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5707, "upload_time": "2014-10-02T08:31:57", "url": "https://files.pythonhosted.org/packages/c4/b9/b5fda6afc606d3f498eb22a8022d8e6c68da784e8f980393b6948767505a/homophony-0.1.7.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fcb61c712a8f002fe8ec277e1759e6bb", "sha256": "d38ce91a193224f6a2ebe8c7a3a7779bf781a60624ace1a4207aa5b059238db9" }, "downloads": -1, "filename": "homophony-0.1.7.1.tar.gz", "has_sig": false, "md5_digest": "fcb61c712a8f002fe8ec277e1759e6bb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5707, "upload_time": "2014-10-02T08:31:57", "url": "https://files.pythonhosted.org/packages/c4/b9/b5fda6afc606d3f498eb22a8022d8e6c68da784e8f980393b6948767505a/homophony-0.1.7.1.tar.gz" } ] }