diff --git a/src/postorius/doc/__init__.py b/src/postorius/doc/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/postorius/doc/__init__.py diff --git a/src/postorius/doc/_build/doctrees/development.doctree b/src/postorius/doc/_build/doctrees/development.doctree index 67f36cd..dab71ed 100644 --- a/src/postorius/doc/_build/doctrees/development.doctree +++ b/src/postorius/doc/_build/doctrees/development.doctree Binary files differ diff --git a/src/postorius/doc/_build/doctrees/environment.pickle b/src/postorius/doc/_build/doctrees/environment.pickle index f631efb..7d858f4 100644 --- a/src/postorius/doc/_build/doctrees/environment.pickle +++ b/src/postorius/doc/_build/doctrees/environment.pickle Binary files differ diff --git a/src/postorius/doc/_build/doctrees/index.doctree b/src/postorius/doc/_build/doctrees/index.doctree index e57d615..6d5cf98 100644 --- a/src/postorius/doc/_build/doctrees/index.doctree +++ b/src/postorius/doc/_build/doctrees/index.doctree Binary files differ diff --git a/src/postorius/doc/_build/doctrees/news.doctree b/src/postorius/doc/_build/doctrees/news.doctree index 96d3c04..97d15a6 100644 --- a/src/postorius/doc/_build/doctrees/news.doctree +++ b/src/postorius/doc/_build/doctrees/news.doctree Binary files differ diff --git a/src/postorius/doc/_build/doctrees/setup.doctree b/src/postorius/doc/_build/doctrees/setup.doctree index a4a42d8..f7cfe80 100644 --- a/src/postorius/doc/_build/doctrees/setup.doctree +++ b/src/postorius/doc/_build/doctrees/setup.doctree Binary files differ diff --git a/src/postorius/doc/_build/html/_sources/development.txt b/src/postorius/doc/_build/html/_sources/development.txt index 45efe00..9cdad7e 100644 --- a/src/postorius/doc/_build/html/_sources/development.txt +++ b/src/postorius/doc/_build/html/_sources/development.txt @@ -25,48 +25,10 @@ } -``postorius.*`` imports in test modules ---------------------------------------- +Running the tests +----------------- -When writing unittests make sure that any ``postorius.*`` imports are made -at the test method level and not at the module level. Here's why: - -The Postorius documentation (the one you are reading right now) imports some -doctest modules from the test package using Sphinx's autodoc extension. This is -a very nice feature, but in this scenario it has the nasty side effect of -breaking the build process if application code is imported as well (it will -fail to find an environment variable that Django needs to run). This can be -easily prevented by avoiding module level imports of postorius code in the test -modules. - -Good: - -:: - - from django.utils import unittest - from mock import patch - - - class SomeTest(unittest.TestCase): - - def test_some_method(self): - from postorius.views import SomeViewClass - foo = 'bar' - -Bad: - -:: - - from django.utils import unittest - from mock import patch - from postorius.views import SomeViewClass - - - class SomeTest(unittest.TestCase): - - def test_some_method(self): - foo = 'bar' - +To run the tests go to your project folder and run ``python manage.py test postorius`` from there. Mocking diff --git a/src/postorius/doc/_build/html/_sources/news.txt b/src/postorius/doc/_build/html/_sources/news.txt index 358c245..75b846d 100644 --- a/src/postorius/doc/_build/html/_sources/news.txt +++ b/src/postorius/doc/_build/html/_sources/news.txt @@ -30,6 +30,10 @@ * installation documentation for Apache/mod_wsgi * moved project files to separate branch * show error message if connection to Mailman API fails +* added list members view +* added developer documentation +* added test helper utils +* all code now conform to PEP8 1.0 alpha 1 -- "Space Farm" diff --git a/src/postorius/doc/_build/html/_static/basic.css b/src/postorius/doc/_build/html/_static/basic.css index 43e8baf..f0379f3 100644 --- a/src/postorius/doc/_build/html/_static/basic.css +++ b/src/postorius/doc/_build/html/_static/basic.css @@ -79,11 +79,11 @@ font-size: 1em; } -div.sphinxsidebar #searchbox input[type="text"] { +div.sphinxsidebar input[type="text"] { width: 170px; } -div.sphinxsidebar #searchbox input[type="submit"] { +div.sphinxsidebar input[type="submit"] { width: 30px; } diff --git a/src/postorius/doc/_build/html/development.html b/src/postorius/doc/_build/html/development.html index 36c46f3..95d139a 100644 --- a/src/postorius/doc/_build/html/development.html +++ b/src/postorius/doc/_build/html/development.html @@ -70,41 +70,9 @@ } -
When writing unittests make sure that any postorius.* imports are made -at the test method level and not at the module level. Here’s why:
-The Postorius documentation (the one you are reading right now) imports some -doctest modules from the test package using Sphinx’s autodoc extension. This is -a very nice feature, but in this scenario it has the nasty side effect of -breaking the build process if application code is imported as well (it will -fail to find an environment variable that Django needs to run). This can be -easily prevented by avoiding module level imports of postorius code in the test -modules.
-Good:
-from django.utils import unittest
-from mock import patch
-
-
-class SomeTest(unittest.TestCase):
-
- def test_some_method(self):
- from postorius.views import SomeViewClass
- foo = 'bar'
-
Bad:
-from django.utils import unittest
-from mock import patch
-from postorius.views import SomeViewClass
-
-
-class SomeTest(unittest.TestCase):
-
- def test_some_method(self):
- foo = 'bar'
-
To run the tests go to your project folder and run python manage.py test postorius from there.
postorius.tests.utils.create_mock_list creates a mock domain object:
+postorius.tests.utils.create_mock_domain creates a mock domain object:
>>> properties = dict(contact_address='postmaster@example.org',
... description='Example dot Org',
... mail_host='example.org',
@@ -192,7 +160,7 @@