<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>bin/django-nosetests.py</filename>
    </added>
    <added>
      <filename>docs/Makefile</filename>
    </added>
    <added>
      <filename>docs/conf.py</filename>
    </added>
    <added>
      <filename>docs/index.rst</filename>
    </added>
    <added>
      <filename>docs/make.bat</filename>
    </added>
    <added>
      <filename>docs/running_tests.rst</filename>
    </added>
    <added>
      <filename>docs/writing_tests.rst</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,6 @@
 build/*
 dist/*
+docs/_build/*
 
 *.db-journal
 *.pyc</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -3,16 +3,19 @@
 include Makefile.def
 
 # Targets
-.PHONY: test clean nosetests run syncdb
+.PHONY: test clean docs nosetests run syncdb
 
 test: clean nosetests
 
 clean:
-	$(MAKE) -C testproject clean
 	-find . -name '*.pyc' -exec rm {} \;
+	-rm testproject/test.db
+
+docs:
+	$(MAKE) -C docs html
 
 nosetests:
-	$(MAKE) -C testproject test
+	PYTHONPATH=$(PYTHONPATH) ./bin/django-nosetests.py --with-django-settings=$(test_settings) -w .. --with-coverage --cover-package=tddspry --exe testproject
 
 run:
 	PYTHONPATH=$(PYTHONPATH) python testproject/manage.py runserver</diff>
      <filename>Makefile</filename>
    </modified>
    <modified>
      <diff>@@ -2,26 +2,23 @@
 tddspry
 =======
 
-1. Introduction_
-2. Requirements_
-3. Installation_
-4. Usage_
+**tddspry** is collection of testcases and additional helpers for testing
+Django applications with nose__ library.
 
-Introduction
-============
-
-**tddspry** is collection of utilities for testing Django applications with
-nosetests_ library.
+.. __: http://somethingaboutorange.com/mrl/projects/nose/
 
-.. _nosetests: http://code.google.com/p/python-nose/
+1. Requirements_
+#. Installation_
+#. Documentation_
+#. `Bugs, features, contacts`_
 
 Requirements
 ============
 
-- Django_ &gt;= 1.0
-- mock_ &gt;= 0.5.0
-- nose_ &gt;= 0.10.3
-- twill_ &gt;= 0.9
+* Django_ &gt;= 1.0
+* mock_ &gt;= 0.5.0
+* nose_ &gt;= 0.10.3
+* twill_ &gt;= 0.9
 
 .. _Django: http://www.djangoproject.com/download/
 .. _mock: http://pypi.python.org/pypi/mock/
@@ -31,72 +28,57 @@ Requirements
 Installation
 ============
 
-To install:
+*On most UNIX-like systems, you'll probably need to run these commands as root
+or using sudo.*
+
+To install::
 
     python setup.py install
 
-Or via easy_install_:
+Or via easy_install_::
 
     easy_install tddspry
 
-Also you can retrieve fresh version of tddspry from GitHub_:
+Also, you can retrieve fresh version of **tddspry** from GitHub_::
 
     git clone git://github.com/playpauseandstop/tddspry.git
 
 .. _easy_install: http://pypi.python.org/pypi/setuptools/
 .. _GitHub: http://github.com/
 
-Usage
-=====
-
-We create **tddspry** to easying testing Django projects and applications.
-Okay, let's see, to test login and logout pages in your Django project, you
-need only::
-
-    from tddspry.django import HttpTestCase
-    from tddspry.django.helpers import create_user
-
-    from django.conf import settings
-
+Documentation
+=============
 
-    class TestLoginPage(HttpTestCase):
+Sphinx_-generated documentation for **tddspry** located at `GitHub pages`_.
+This documentation updates after every **tddspry** release.
 
-        def test_login(self):
-            user = create_user('username', 'password')
-            self.login('username', 'password')
-            self.url(settings.LOGIN_REDIRECT_URL)
+Fresh documentation always can access in ``docs/`` directory.
 
-        def test_logout(self):
-            user = create_user('username', 'password')
-            self.login('username', 'password')
-            self.logout()
-            self.url('/')
+.. _Sphinx: http://sphinx.pocoo.org/
+.. _`GitHub pages`: http://playpauseandstop.github.com/tddspry/
 
-That's all ;) But really for ``test_login``,
+Bugs, features, contacts
+========================
 
-* First, ``HttpTestCase`` creates test ``sqlite3`` database in memory and
-  starts Django WSGI-server.
+Sending bugs and features
+-------------------------
 
-* Then, we creates test user by ``create_user`` helper.
+We use ``tddspry`` in all our projects, so we hope that it hasn't any bug,
+but if you really find it - send it to `issues tracker`__ on GitHub.
 
-* Next, twill browser goes to your ``'auth_login'`` page and checks that
-  response code is 200.
+And if ``tddspry`` does not support feature needed to you - tell us too and
+we tries to adds it as soon as possible.
 
-* Next, twill browser fill out login form with ``username`` and ``password``
-  values and submits it. Also here twill browser again checks that response
-  code is 200.
+.. __: http://github.com/playpauseandstop/tddspry/issues
 
-* And finally, we check that current url after success login is our
-  ``LOGIN_REDIRECT_URL`` that set in projects settings.
+Contacts
+--------
 
-And for ``test_logout`` we repeate these steps and adding logging out from
-current Django session and simple check that after logout we go to index page.
+:Authors:
+    Igor Davydenko *&lt; playpauseandstop [at] gmail &gt;*,
 
-Easy? No? Okay, `create new issue`_ on GitHub and say how exactly create easy
-tests for Django applications :)
+    Volodymyr Hotsyk *&lt; gotsyk [at] gmail &gt;*
 
-**ps.** More examples how-to usage **tddspry** exist in tests for
-``testproject`` project in `tddspry repository`_.
+:Idea:
+    Andriy Khavryuchenko *&lt; akhavr [at] gmail &gt;*
 
-.. _`create new issue`: http://github.com/playpauseandstop/tddspry/issues
-.. _`tddspry repository`: http://github.com/playpauseandstop/tddspry</diff>
      <filename>README.rst</filename>
    </modified>
    <modified>
      <diff>@@ -26,9 +26,10 @@ setup(name='tddspry',
       maintainer='Igor Davydenko',
       maintainer_email='playpauseandstop@gmail.com',
       url='http://github.com/playpauseandstop/tddspry',
-      packages=['tddspry', 'tddspry.django'],
+      packages=['tddspry', 'tddspry.django', 'tddspry.django.helpers'],
+      scripts=['bin/django-nosetests.py'],
       classifiers=[
-        'Development Status :: 3 - Alpha',
+        'Development Status :: 4 - Beta',
         'Environment :: Web Environment',
         'Framework :: Django',
         'License :: OSI Approved :: GNU General Public License (GPL)',</diff>
      <filename>setup.py</filename>
    </modified>
    <modified>
      <diff>@@ -1,25 +1,11 @@
 &quot;&quot;&quot;
-=======
-tddspry
-=======
+``tddspry`` provides ``NoseTestCase`` class to base functional testing.
 
-Utilities to test Django applications with nosetests and twill.
-
-TestCases
-=========
-
-NoseTestCase
-------------
-
-Base ``TestCase`` in ``tddspry``. The main advantages with standart Python's
-``unittest.TestCase`` are that it depends ``object`` and all functions from
-`nose.tools`_ existed as ``NoseTestCase``'s methods.
-
-.. _`nose.tools`: http://code.google.com/p/python-nose/wiki/TestingTools
+.. autoclass :: tddspry.NoseTestCase
 
 &quot;&quot;&quot;
 
 from tddspry.cases import *
 
 
-VERSION = (0, 2, 3)
+VERSION = (0, 3, 'beta')</diff>
      <filename>tddspry/__init__.py</filename>
    </modified>
    <modified>
      <diff>@@ -28,5 +28,52 @@ class NoseTestCaseMetaclass(type):
 
 
 class NoseTestCase(BaseTestCase):
+    &quot;&quot;&quot;
+    For convenience this class consist of all functions exists in nose.tools__
+    module.
+
+    .. __: http://somethingaboutorange.com/mrl/projects/nose/0.11.0/testing_tools.html
+
+    So, if you have functions, like this::
+
+        def addititon(first, second):
+            return first + second
+
+        def division(first, second):
+            if not second:
+                raise ValueError
+            return first / second
+
+        def multiplication(first, second):
+            return first * second
+
+        def subtraction(first, second):
+            return first - second
+
+    You can write simple ``TestFunctions`` class to test its::
+
+        from tddspry import NoseTestCase
+
+
+        class TestFunctions(NoseTestCase):
+
+            def test_addition(self):
+                self.assert_equal(addititon(1, 2), 3)
+                self.assert_not_equal(addititon(1, 2), 2)
+
+            def test_division(self):
+                self.assert_equal(division(4, 2), 2)
+                self.assert_not_equal(division(5.0, 2), 2)
+                self.assert_raises(ValueError, division, 2, 0)
+
+            def test_multiplication(self):
+                self.assert_equal(multiplication(1, 2), 2)
+                self.assert_not_equal(multiplication(1, 2), 3)
+
+            def test_subtraction(self):
+                self.assert_equal(subtraction(2, 1), 1)
+                self.assert_equal(subtraction(2, 1), 2)
+
+    &quot;&quot;&quot;
 
     __metaclass__ = NoseTestCaseMetaclass</diff>
      <filename>tddspry/cases.py</filename>
    </modified>
    <modified>
      <diff>@@ -1,74 +1,129 @@
 &quot;&quot;&quot;
-==============
-tddspry.django
-==============
+``tddspry.django`` provides ``DatabaseTestCase`` and ``HttpTestCase`` classes
+to testing Django applications.
 
-TestCases
-=========
+Database tests with ``DatabaseTestCase``
+----------------------------------------
 
-``tddspry.django`` serves several custom ``TestCase``'s for test your Django's
-applications.
+For testing Django model classes and anything objects that needed database
+connection you should be used ``tddspry.django.DatabaseTestCase``. This
+test-case inherits ``tddspry.TestCase``, so consists of all nose tools
+functions and decorators.
 
-DatabaseTestCase
-----------------
+At ``setup`` ``DatabaseTestCase`` creates test database or flushes it if
+needed and loading fixtures if possible (``database_name``,
+``database_flush`` and ``fixtures`` attributes).
 
-Depends on ``NoseTestCase``. On ``setup`` ``DatabaseTestCase`` creates test
-``sqlite3`` database in ``:memory:`` and on ``teardown`` removes it.
+Also for convenience ``DatabaseTestCase`` has additional helpers:
 
-Custom methods
-~~~~~~~~~~~~~~
+.. autoclass :: tddspry.django.DatabaseTestCase
+   :members:
 
-* check_create(model, \*\*kwargs)
+**Note:** Also ``DatabaseTestCase`` can call additional helper by
+`helper`` method. `See below`_ how use it.
 
-* check_delete(instance)
+Usage
+~~~~~
 
-* check_update(instance, \*\*kwargs)
+So, for testing CRUD_ of ``django.contrib.auth.models.Group`` model you can
+write next test case::
 
-HttpTestCase
-------------
+    from tddspry.django import DatabaseTestCase
 
-Depends on ``DatabaseTestCase``. On ``setup`` ``HttpTestCase`` creates test
-database via ``django.db.connection.creation.create_test_db`` and on
-``teardown`` removes it.
+    from django.contrib.auth.models import Group
 
-Also this ``TestCase`` consists of all twill_ functions as class methods.
 
-.. _twill: http://twill.idyll.org/commands.html
+    NEW_NAME = 'Super-Test Group'
+    TEST_NAME = 'Test Group'
 
-Custom methods
-~~~~~~~~~~~~~~
 
-* find(what, flags='', flat=False)
+    class TestGroup(DatabaseTestCase):
 
-  Use ``flat=True`` to disable regexp matching and use raw ``what in html``
-  expression.
+        def test_create(self):
+            self.assert_create(Group, name=TEST_NAME)
 
-* notfind(what, flags='', flat=False)
+        def test_delete(self):
+            group = self.assert_create(Group, name=TEST_NAME)
+            self.assert_delete(group)
 
-  Use ``flat=True`` to disable regexp matching and use raw ``not what in html``
-  expression.
+        def test_read(self):
+            self.assert_create(Group, name=TEST_NAME)
+            self.assert_read(Group, name=TEST_NAME)
 
-More custom helpers for http tests you can find in Helpers_ section.
+        def test_update(self):
+            group = self.assert_create(Group, name=TEST_NAME)
+            self.assert_update(group, name=NEW_NAME)
 
-Helpers
-=======
+.. _`See below`: `Additional helpers`
+.. _CRUD: http://en.wikipedia.org/wiki/Create,_read,_update_and_delete
 
-Also ``tddspry.django`` gives several custom helpers to easying your http
-tests. To import it use::
+Server-side tests with ``HttpTestCase``
+---------------------------------------
 
-    from tddspry.django.helpers import *
+In addition to ``DatabaseTestCase`` ``tddspry.django`` provides
+``HttpTestCase`` class to testing HTTP responses with `Twill browser`_ and
+`django.test.Client`_.
 
-List of helpers:
+At setup ``HttpTestCase`` run Django WSGI server and connects it with
+twill browser.
 
-* go200(url)
+For historical reasons ``HttpTestCase`` was developed for testing Django
+applications with Twill browser, so its consists of all functions exists
+in `twill.commands`_ module as class methods.
 
-* login(USERNAME, PASSWORD, login_url=settings.LOGIN_URL, form_id=1)
+And for convenience several twill methods was simplifying and rewriting, there
+are:
 
-* login_to_admin(USERNAME, PASSWORD)
+.. automethod :: tddspry.django.HttpTestCase.find
+.. automethod :: tddspry.django.HttpTestCase.go
+.. automethod :: tddspry.django.HttpTestCase.notfind
+.. automethod :: tddspry.django.HttpTestCase.url
 
-* logout(logout_url=settings.LOGOUT_URL)
+And from `0.3 release`_ of ``tddspry`` ``HttpTestCase`` consist of ``client``
+attribute that stores instance of ``django.test.Client`` class.
 
-* submit200()
+Also, ``HttpTestCase`` provides next methods:
+
+.. automethod :: tddspry.django.HttpTestCase.build_url
+.. automethod :: tddspry.django.HttpTestCase.disable_edit_hidden_fields()
+.. automethod :: tddspry.django.HttpTestCase.disable_redirect()
+.. automethod :: tddspry.django.HttpTestCase.enable_edit_hidden_fields()
+.. automethod :: tddspry.django.HttpTestCase.enable_redirect()
+.. automethod :: tddspry.django.HttpTestCase.go200
+.. automethod :: tddspry.django.HttpTestCase.login
+.. automethod :: tddspry.django.HttpTestCase.login_to_admin
+.. automethod :: tddspry.django.HttpTestCase.logout
+.. automethod :: tddspry.django.HttpTestCase.submit200
+
+.. _`0.3 release`: http://pypi.python.org/pypi/tddspry/0.3
+
+Usage
+~~~~~
+
+So, for testing login/logout process in your project you can write next
+test-case::
+
+    from tddspry.django import HttpTestCase
+
+    from django.conf import settings
+
+
+    class TestLoginPage(HttpTestCase):
+
+        def test_login(self):
+            user = self.helper('create_user', 'username', 'password')
+            self.login('username', 'password')
+            self.url(settings.LOGIN_REDIRECT_URL)
+
+        def test_logout(self):
+            user = self.helper('create_user', 'username', 'password')
+            self.login('username', 'password')
+            self.logout()
+            self.url('/')
+
+.. _`Twill browser`: http://twill.idyll.org/
+.. _`django.test.Client`: http://docs.djangoproject.com/en/dev/topics/testing/#module-django.test.client
+.. _`twill.commands`: http://twill.idyll.org/commands.html
 
 &quot;&quot;&quot;
 </diff>
      <filename>tddspry/django/__init__.py</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>testproject/Makefile</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>5f0a1c42b070a4d0fd5e5d14fc0815c7980af55d</id>
    </parent>
  </parents>
  <author>
    <name>Igor Davydenko</name>
    <email>playpauseandstop@gmail.com</email>
  </author>
  <url>http://github.com/playpauseandstop/tddspry/commit/0e0eada69e834d54826b8eec886640b08354162c</url>
  <id>0e0eada69e834d54826b8eec886640b08354162c</id>
  <committed-date>2009-05-09T15:47:58-07:00</committed-date>
  <authored-date>2009-05-09T15:47:58-07:00</authored-date>
  <message>Massive changes to ``tddpsry``:

* Adds Sphinx'ed documentation to ``tddspry``.
* Adds ``django-nosetests.py`` command utility.
* Rewrites ``README`` file.
* Updates ``Makefile`` and Git ignore list.
* Updates ``setup.py`` file.</message>
  <tree>64ca26004c24b299557744af833c08d92a16f1e3</tree>
  <committer>
    <name>Igor Davydenko</name>
    <email>playpauseandstop@gmail.com</email>
  </committer>
</commit>
