{"id":13937219,"url":"https://github.com/playpauseandstop/tddspry","last_synced_at":"2025-12-30T16:56:29.806Z","repository":{"id":57473692,"uuid":"136525","full_name":"playpauseandstop/tddspry","owner":"playpauseandstop","description":"Collection of testcases and helpers to test Django projects and applications with nose and twill libraries.","archived":true,"fork":false,"pushed_at":"2011-03-01T15:01:12.000Z","size":2082,"stargazers_count":37,"open_issues_count":1,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-09-17T02:44:44.895Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://playpauseandstop.github.com/tddspry/","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/playpauseandstop.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-02-24T18:51:17.000Z","updated_at":"2023-12-26T09:36:16.000Z","dependencies_parsed_at":"2022-09-26T17:40:55.451Z","dependency_job_id":null,"html_url":"https://github.com/playpauseandstop/tddspry","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playpauseandstop%2Ftddspry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playpauseandstop%2Ftddspry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playpauseandstop%2Ftddspry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/playpauseandstop%2Ftddspry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/playpauseandstop","download_url":"https://codeload.github.com/playpauseandstop/tddspry/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226693903,"owners_count":17667757,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-07T23:03:23.916Z","updated_at":"2025-12-13T18:03:35.207Z","avatar_url":"https://github.com/playpauseandstop.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"=======\ntddspry\n=======\n\nCollection of testcases and helpers to test Django projects and applications\nwith `nose \u003chttp://somethingaboutorange.com/mrl/projects/nose/\u003e`_ and\n`twill \u003chttp://twill.idyll.org/\u003e`_ libraries.\n\n#. `Key features`_\n#. `Quick examples`_\n\n   #. `Writing tests`_\n   #. `Running tests`_\n\n#. Requirements_\n#. Installation_\n#. License_\n#. Documentation_\n#. `Sending bugs and feature requests`_\n#. Contacts_\n\nKey features\n============\n\n* Support of assert methods from unittest2_ library (``assertIn``, ``assertIs``\n  and others).\n* Full support of all features from ``django.test.TestCase`` or\n  ``django.test.TransationalTestCase`` classes.\n* Run tests for Django projects and applications via ``nosetests`` command\n  instead of ``python manage.py test``. You don't need to place tests in\n  ``tests`` module - ``nosetests`` automaticly find its in project or\n  application.\n* Assert methods for testing Django models (``assert_create``,\n  ``assert_count``, etc).\n* Test web responses with ``twill`` library instead of using\n  ``django.test.Client``.\n* Helpers for make particular actions in tests (create users or superusers,\n  login or logout from projects).\n\n.. _unittest2: http://pypi.python.org/pypi/unittest2\n\nQuick examples\n==============\n\nWriting tests\n-------------\n\nDatabase test\n~~~~~~~~~~~~~\n\nCheck that ``username`` field of standart ``auth.User`` model is unique::\n\n    from tddspry.django import TestCase\n\n    from django.contrib.auth.models import User\n\n\n    TEST_EMAIL = 'test-email@domain.com'\n    TEST_PASSWORD = 'test-password'\n    TEST_USERNAME = 'test-username'\n\n\n    class TestUserModel(TestCase):\n\n        def test_unique(self):\n            self.assert_create(User,\n                               username=TEST_USERNAME,\n                               password=TEST_PASSWORD,\n                               email=TEST_EMAIL)\n            self.assert_raises(Exception,\n                               self.assert_create,\n                               User,\n                               username=TEST_USERNAME,\n                               password=TEST_PASSWORD,\n                               email=TEST_EMAIL)\n\nHttp (twill) test\n~~~~~~~~~~~~~~~~~\n\nLogin into project and check that login url does not exist in index page and\nlogout and profile links exist::\n\n    from tddspry.django import TestCase\n\n\n    class TestHttp(TestCase):\n\n        def setup(self):\n            # Create user\n            self.user = self.helper('create_user')\n\n            # Login this user into project\n            self.login(self.helpers.USERNAME, self.helpers.PASSWORD)\n\n        def test_index_links(self):\n            # Login, logout and profile urls\n            login_url = self.build_url('auth_login')\n            logout_url = self.build_url('auth_logout')\n            profile_url = self.build_url('auth_profile')\n\n            # Go to index page\n            self.go200('/')\n\n            # Login url does not exist cause user already logged in\n            self.notfind(login_url)\n\n            # But logout and profile url exist\n            # Profile url must find at page 3 times\n            self.find(logout_url)\n            self.find(profile_url, count=3)\n\nRunning tests\n-------------\n\nThere are three ways to run tests in your project.\n\nFirst, using ``nosetests`` command, e.g.::\n\n    $ nosetests --with-django --django-settings=project.settings project\n    $ DJANGO_SETTINGS_MODULE=project.settings NOSE_WTIH_DJANGO=1 nosetests project\n\nThis way requires install ``tddspry`` to your system.\n\nSecond, using ``django-nosetests.py`` script, e.g.::\n\n    $ django-nosetests.py --django-settings=project.settings project\n    $ DJANGO_SETTINGS_MODULE=project.settings django-nosetests.py project\n\nThis script is wrapper to previous method (you don't need to run ``nosetests``\nwith ``--with-django`` option or ``NOSE_WTIH_DJANGO`` environment var), but\ndoes not require install ``tddspry`` to your system (it's good idea if you want\nuse latest development version of ``tddspry``). Script located in ``bin/``\ndirectory.\n\nThird, using ``TEST_RUNNER`` setting in Django \u003e= 1.2 (requires `django-nose\napp \u003chttp://github.com/jbalogh/django-nose\u003e`_ installed)::\n\n    TEST_RUNNER = 'tddspry.django.runner.TestSuiteRunner'\n\nThen you can use Django's internal ``test`` manage command to run your tests::\n\n    $ ./manage.py test\n\nOtherwise, you can use all `power of nosetests command\n\u003chttp://somethingaboutorange.com/mrl/projects/nose/0.11.0/usage.html\u003e`_ to run\ntests in your Django project or applications.\n\nRequirements\n============\n\n* `Python \u003chttp://www.python.org/\u003e`_ 2.4 or above\n* `Django \u003chttp://www.djangoproject.com/\u003e`_ up to trunk\n* `nose \u003chttp://somethingaboutorange.com/mrl/projects/nose/\u003e`_ 0.11.0 or above\n* `twill \u003chttp://twill.idyll.org/\u003e`_ 0.9\n* `django-nose \u003chttp://github.com/jbalogh/django-nose\u003e`_ (*optional*, required\n  by test runner)\n* `datadiff \u003chttp://pypi.python.org/pypi/datadiff\u003e`_ (*optional*, required by\n  ``TDDSPRY_USE_DATADIFF`` setting)\n\nInstallation\n============\n\n*On most UNIX-like systems, you'll probably need to run these commands as root\nor using sudo.*\n\nTo install use::\n\n    $ pip install tddspry\n\nOr::\n\n    $ python setup.py install\n\nAlso, you can retrieve fresh version of ``tddspry`` from `GitHub\n\u003chttp://github.com/playpauseandstop/tddspry\u003e`_::\n\n    $ git clone git://github.com/playpauseandstop/tddspry.git\n\nand place ``tddspry`` directory somewhere to ``PYTHONPATH`` (or ``sys.path``).\n\nLicense\n=======\n\n``tddspry`` is licensed under the `BSD License\n\u003chttp://github.com/playpauseandstop/tddspry/blob/master/LICENSE\u003e`_.\n\nDocumentation\n=============\n\n`Sphinx \u003chttp://sphinx.pocoo.org/\u003e`_-generated documentation for ``tddspry``\nlocated at `GitHub pages \u003chttp://playpauseandstop.github.com/tddspry/\u003e`_. This\ndocumentation updates after every ``tddspry`` release.\n\nFresh documentation always can access in ``docs/`` directory.\n\nSending bugs and feature requests\n=================================\n\nFound a bug? Have a good idea for improving tddspry? Head over to `tddspry's\ntrac \u003chttp://trac.khavr.com/agiloprojects/tddspry\u003e`_ to create a new ticket or\nto `GitHub`_ to create a new fork.\n\nContacts\n========\n\n:Authors:\n    Igor Davydenko *\u003c playpauseandstop [at] gmail \u003e*,\n    Volodymyr Hotsyk *\u003c gotsyk [at] gmail \u003e*\n\n:Idea:\n    Andriy Khavryuchenko *\u003c akhavr [at] gmail \u003e*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplaypauseandstop%2Ftddspry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplaypauseandstop%2Ftddspry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplaypauseandstop%2Ftddspry/lists"}