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 @@ } -
-

postorius.* imports in test modules

-

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'
-
-
+
+

Running the tests

+

To run the tests go to your project folder and run python manage.py test postorius from there.

Mocking

@@ -122,7 +90,7 @@

Mocking mailman.client objects

Domains
-

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 @@
   
\ No newline at end of file diff --git a/src/postorius/doc/_build/html/genindex.html b/src/postorius/doc/_build/html/genindex.html index 74be522..cf95631 100644 --- a/src/postorius/doc/_build/html/genindex.html +++ b/src/postorius/doc/_build/html/genindex.html @@ -117,7 +117,7 @@
\ No newline at end of file diff --git a/src/postorius/doc/_build/html/index.html b/src/postorius/doc/_build/html/index.html index 9a2dfed..aa21bde 100644 --- a/src/postorius/doc/_build/html/index.html +++ b/src/postorius/doc/_build/html/index.html @@ -110,7 +110,7 @@
\ No newline at end of file diff --git a/src/postorius/doc/_build/html/news.html b/src/postorius/doc/_build/html/news.html index c1639ee..fa2409e 100644 --- a/src/postorius/doc/_build/html/news.html +++ b/src/postorius/doc/_build/html/news.html @@ -37,9 +37,6 @@ index
  • - modules |
  • -
  • next |
  • @@ -78,6 +75,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
  • @@ -154,9 +155,6 @@ index
  • - modules |
  • -
  • next |
  • @@ -167,7 +165,7 @@
  • \ No newline at end of file diff --git a/src/postorius/doc/_build/html/py-modindex.html b/src/postorius/doc/_build/html/py-modindex.html index ae85022..aa9ec3a 100644 --- a/src/postorius/doc/_build/html/py-modindex.html +++ b/src/postorius/doc/_build/html/py-modindex.html @@ -125,7 +125,7 @@
    \ No newline at end of file diff --git a/src/postorius/doc/_build/html/search.html b/src/postorius/doc/_build/html/search.html index dfe5cd1..fd1824c 100644 --- a/src/postorius/doc/_build/html/search.html +++ b/src/postorius/doc/_build/html/search.html @@ -99,7 +99,7 @@ \ No newline at end of file diff --git a/src/postorius/doc/_build/html/searchindex.js b/src/postorius/doc/_build/html/searchindex.js index f2443b1..8cad9b5 100644 --- a/src/postorius/doc/_build/html/searchindex.js +++ b/src/postorius/doc/_build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({objects:{tests:{tests:[3,0,1,""]},"postorius.tests":{test_utils:[0,0,1,""]}},terms:{all:[0,4,2,3],code:[0,4,3],forget:3,prefil:3,test_list_set:0,four:[],ackownledg:[],runserv:2,dirnam:[],follow:[3,2],profil:4,decid:[],depend:[4,2],authoris:[],mailman_them:[],descript:[0,3],send:[],granci:4,under:4,introduc:[],merchant:4,sourc:[],everi:[],string:3,far:[],authbackend:[],none:3,offlin:[],util:[0,3],context_processor:[],mechan:3,veri:0,exact:3,foo:0,contenttyp:[],administr:3,level:0,did:3,button:3,list:[0,4,3],contact_address:0,"try":3,item:3,adjust:[],anna:4,quick:[],setup:[4,2,3],dir:[],pleas:3,modelbackend:[],impli:4,core:[],cfg:[],seper:[],request:3,past:[],second:2,download:2,further:[],click:3,compat:[],index:3,what:[],name_of_permiss:[],appear:[],richard:4,sum:[],abl:[3,2],current:3,delet:3,new_list1:3,postoriu:[0,1,2,4],franziska:[],"new":[1,3,4],net:[],method:0,superus:2,publicli:2,gener:4,never:2,remeb:[],here:0,themself:[],ubuntu:[],path:2,along:4,modifi:[4,3],sinc:2,valu:3,search:[],mailinglist:[],vertifi:[],anymor:[],errorlog:[],host:[],proud:[],jame:3,doctest:[0,3],action:3,chang:2,mailman_media:[],element:[],contactpag:[],via:[],appli:[],app:[4,3],sponser:[],foundat:4,put:0,api:4,sponsel:[],instal:[1,2,3,4],myownunittest:0,middlewar:[],from:[0,3,2],describ:3,would:[],commun:[],doubl:3,two:[],perm:[],next:[],websit:[],few:[],call:4,typo:4,recommend:[],suppos:[],type:3,web_host:3,create_mock_list:0,mailman_django:[],abspath:[],relat:3,ital:[],list_own:3,warn:[3,2],trail:[],berlio:[],stick:[],autodoc:0,particular:4,dooo:[],hold:[],unpack:[],easiest:3,correctli:[],customlog:[],account:[4,2],join:[],alia:2,prepar:2,work:[],uniqu:[],dev:[4,2],mock_list2:[],archiv:3,can:[0,4,2,3],purpos:4,def:0,control:[],defer:4,sqlite:2,prompt:2,login_requir:3,tar:[],process:[0,4],sudo:2,accept:4,topic:[],want:[3,2],create_mock_memb:0,yet:[],create_mock_domain:0,contribut:4,alwai:2,cours:[],multipl:[],permission_requir:[],anoth:3,faulti:[],georg:3,write:0,how:2,list_nam:0,reject:4,instead:3,simpl:[],"__file__":[],css:2,updat:3,product:2,resourc:3,farm:4,stop:3,earlier:[],usabl:[],befor:3,membership:[0,3],date:2,end:[],hardcopi:[],third:2,postfix:[],bind:[],bootstrap:[],credenti:[],django:[0,4,2,3],alias:4,environ:[0,2],adverrtis:3,jain:4,enter:3,fallback:[],automaticli:[],egg:[],order:2,listnam:3,help:[],move:4,becaus:3,has_perm:[],own:[0,3],left:[],style:[],directli:3,fit:4,fix:4,browserid:4,unicode_liter:[],better:[],requir:3,onc:[],mail:[0,4,3],hidden:[],main:[],might:[],guarente:[],them:[0,2],good:0,"return":[],thei:3,python:[3,2],databs:[],auth:[],unfortuneatli:[],"break":0,mention:3,front:3,bar:0,now:[0,3,2],term:4,benst:[],somewher:2,name:[0,3],anyth:[],edit:[4,3],config:[],postorius_error:[],authent:[],separ:[4,3],easili:0,senarclen:4,each:3,debug:3,found:[3,2],went:3,mailman_test_bindir:[],everyth:3,domain:[0,4,3],replac:[],idea:[],procedur:[],realli:3,line:[3,2],redistribut:4,meta:3,"static":2,connect:4,our:3,todo:[],dependeci:[],out:4,variabl:0,shown:3,space:4,miss:4,robert:2,develop:[0,1,2,3,4],publish:4,your:[0,2],content:[1,3],daniel:4,rest_serv:[],got:[],correct:2,after:[3,2],insid:[],free:[4,3],standalon:[],reason:[],base:[],mailmanweb:[],lists_of_domain:[],releas:2,org:[0,4,2],"40mail":3,launch:[],could:[],wrong:3,keep:2,filter:[],thing:3,place:[],isn:[],root_urlconf:[],requireti:[],view:[0,3],first:[3,2],softwar:4,rang:[],woun:[],render:[],prevent:0,feel:3,media_root:[],system:[],restrict:3,mai:[],instruct:[3,2],alreadi:3,done:3,least:3,authentif:3,owner:3,stabl:3,installed_app:[],open:3,gpl:[],differ:2,rrze:[],my_own_test:0,benedict:4,data:3,licens:4,natti:[],messag:[4,3],url_host:0,too:0,licenc:[],fullfil:[],"final":3,store:[],shell:3,option:3,real_nam:3,"public":4,copi:4,specifi:3,gsoc:[],part:3,"__test__":0,exactli:[],priveledg:[],serv:2,test_some_method:0,provid:[4,2,3],remov:[4,3],new_domain:[],project:[4,2],postorius_standalon:2,were:3,posit:3,minut:[],fqdn_listnam:[0,3],pre:[],descrip:[],sai:[],runner:0,ani:[0,4],postorius_access:[],packag:[0,2],gui:3,have:[4,2,3],tabl:2,need:[0,3,2],foord:0,wsgiscriptalia:2,engin:2,inform:2,florian:[],destroi:[],self:0,client:[0,3,2],note:[3,2],also:2,exampl:[0,3],take:[],indic:3,combin:[],mock_memb:0,singl:3,even:4,sure:[0,3,2],kati:3,allow:[3,2],shall:3,usernam:[],object:[0,3],asdasd:[],most:3,plan:[],letter:3,watt:3,alpha:4,choos:3,"class":0,icon:[],collectstat:2,don:3,bzr:2,url:3,doc:[],later:[],cover:2,temporili:3,doe:3,deni:2,pars:3,usual:[],dot:0,wsgi:2,show:[4,3],text:3,liza:3,session:3,permiss:3,corner:[],fine:[],find:0,redirect:3,absolut:[],onli:[3,2],submit:3,locat:2,launchpad:2,copyright:4,explain:3,configur:[],apach:[4,2],should:[0,4,2,3],version:[4,2],dict:0,templat:4,folder:[0,2],local:[3,2],hope:4,media_url:[],hit:[],nearli:[],get:[3,2],nasti:0,pypi:2,obviou:[],rest:3,csrf:4,awai:[],restart:[],retreiv:0,template_dir:[],patch:0,reload:2,bad:0,common:[],restadmin:[],mm_membership:3,where:0,summari:3,wiki:[],set:[0,4,2,3],sometest:0,see:[4,2,3],domain_admin:[],result:[],respons:3,testcas:0,wonder:[],awar:3,statu:3,error:4,magicmock:0,databas:[3,2],someth:3,test_list_memb:0,behind:[],quickest:2,between:3,"import":[0,3],subscript:3,email:3,realnam:[],coder:2,extens:0,correclti:[],advertis:3,subfold:[],thank:4,both:[],last:3,plugin:[],admin:2,howev:[],etc:2,instanc:3,context:[],delete_list:3,logout:[],login:[4,3],com:3,load:3,simpli:3,point:[],instanti:[],overview:3,unittest:0,address:[0,3],mock_list:0,header:[],non:[],littl:0,linux:3,guid:[3,2],assum:2,backend:[],quit:[],trunk:[],mailman:[0,1,2,3,4],coupl:3,"0a7":[],been:3,compon:[],much:[],unsubscrib:[4,3],modif:[],futur:[],addit:[],quickli:0,upcom:[],imag:2,xxx:[],togeth:3,rememb:[],i18n:[],ngeorg:3,niederreit:2,those:3,"case":3,creativecommon:[],therefor:[],look:[],gnu:[4,2],plain:[],align:[],properti:0,lesser:4,"while":2,dashboard:3,abov:3,mail_host:[0,3],everyon:[],authentication_backend:[],new_list:[],almost:2,demo:[],metric:4,site:[3,2],itself:[],revis:[],create_list:[],"__init__":0,decor:3,let:3,welcom:[],author:[],receiv:4,media:[],make:[0,3,2],belong:3,same:3,member:0,handl:[],html:[],split:[],document:[0,4,2],mod_wsgi:[4,2],behav:0,finish:3,http:[4,2,3],webserv:2,upon:[],effect:0,moment:[],http_host:3,initi:4,mani:4,implement:4,expand:[],appropri:[],moder:4,scenario:0,framework:[],api_pass:3,well:[0,3,2],membership_set:[],without:[4,3],command:[],thi:[0,4,2,3],english:3,fail:[0,4,3],latest:2,summer:4,just:2,absolute_import:[],mailman3:3,webui:[],test_util:0,restbackend:[],languag:3,web:[1,2,4],display_nam:0,easi:[],project_path:[],had:[],list_summari:3,shortcut:0,apache2:[],add:[0,4,3],valid:3,lawrenc:[],save:[],modul:[0,3],build:0,bin:[],applic:[0,2],which:[3,2],stein:4,unter:[],read:0,prefer:2,testlist:0,writabl:2,know:2,gsoc_mailman:[],press:3,cooki:[],bit:0,password:[],tweak:[],mailmanwebgsoc2011:[],template_context_processor:[],resid:[0,2],like:0,success:[4,3],changelog:[1,4],restpass:[],server:[4,2],collect:2,href:[],setup_mm:3,either:3,page:3,www:[0,4],right:0,acknowledg:[],creation:3,some:[0,3],back:[],proper:4,home:[],funcit:[],librari:0,distribut:4,basic:4,buildout:2,djangoproject:[],confirm:3,avoid:0,httpredirectobject:3,token:4,servernam:[],select:[],slash:[],necessari:2,testobject:3,localhost:3,refer:3,machin:3,httpresponseredirect:3,who:[],run:[0,3,2],bold:[],symlink:[],step:[],repositori:[],post:3,bazaar:2,mm_new_domain:[],stage:[],src:0,about:[],central:[],usa:3,mass_subscrib:3,rohan:4,side:0,listmembersviewtest:0,srv:2,act:2,fals:3,discard:4,processor:[],block:3,"__future__":[],addus:[],status_cod:3,pythonpath:2,xyz:[],within:3,someviewclass:0,easy_instal:2,warranti:4,creativ:[],empti:3,contrib:[],api_us:3,manag:[3,2],choosen:3,span:3,log:3,wai:[3,2],"40exampl":3,execut:3,print:[0,3],"long":[],custom:[],avail:[3,2],start:[3,2],reli:[],interfac:[4,2],includ:3,suit:3,"var":[],systers_django:[],"function":3,head:[],form:[4,3],offer:3,subscrib:[4,3],requestfactori:[],link:3,translat:3,teardown_mm:3,eas:[],"true":3,info:4,pull:2,succe:3,made:[0,3],render_mailman_them:[],mock_domain:0,possibl:2,whether:3,access:[4,3],displai:3,below:3,memebership:[],otherwis:[],more:4,postmast:0,extend_ajax:[],featur:0,creat:[0,3,2],hardcod:[],dure:[4,3],doesn:[],listsettingsviewtest:0,exist:[],file:[4,2],syncdb:2,pip:2,wackerbarth:4,check:[4,3],acl:[],again:[],readi:2,successfulli:[],googl:4,titl:[],user:[0,4,2,3],when:0,detail:[4,2],gettext:3,"default":[],mizyrycki:4,other:3,special:[],branch:[4,2],test:[0,3],you:[0,4,2,3],mock:0,nice:[0,3],michael:0,why:[0,3],prequir:[],consid:[],stai:[],outdat:3,sphinx:0,bullet:[],directori:[0,3,2],came:[],enjoi:3,bottom:[],virtualhost:2,rule:[],mailman3a7:[],mass:[4,3],dev_setup:[],time:[3,2],escap:3,inc:4},objtypes:{"0":"py:module"},titles:["Development","Postorius - The New Mailman Web UI","Installation","Using the Django App - Developers Resource (outdated)","News / Changelog"],objnames:{"0":["py","module","Python module"]},filenames:["development","index","setup","using","news"]}) \ No newline at end of file +Search.setIndex({objects:{tests:{tests:[4,0,1,""]},"postorius.tests":{test_utils:[0,0,1,""]}},terms:{all:[0,4,2,3],code:[4,3],forget:4,prefil:4,test_list_set:0,four:[],ackownledg:[],runserv:2,dirnam:[],follow:[4,2],content:[1,4],decid:[],depend:[3,2],authoris:[],send:[],shall:4,granci:3,under:3,introduc:[],merchant:3,sourc:[],everi:[],string:4,without:[4,3],far:[],none:4,offlin:[],util:[0,4,3],context_processor:[],mechan:4,veri:[],exact:4,mailmanwebgsoc2011:[],testobject:4,contenttyp:[],administr:4,level:[],did:4,button:4,list:[0,4,3],liza:4,"try":4,item:4,adjust:[],localhost:4,quick:[],setup:[4,2,3],dir:[],pleas:4,modelbackend:[],impli:3,httpresponseredirect:4,cfg:[],seper:[],request:4,past:[],second:2,download:2,further:[],click:4,compat:[],index:4,what:[],name_of_permiss:[],appear:[],richard:3,sum:[],abl:[4,2],current:4,delet:4,new_list1:4,postoriu:[0,1,2,3],franziska:[],"new":[1,3,4],net:[],method:[],abov:4,gener:3,never:2,remeb:[],here:[],themself:[],ubuntu:[],path:2,along:3,modifi:[4,3],sinc:2,valu:4,search:[],mailinglist:[],vertifi:[],anymor:[],errorlog:[],step:[],jame:4,doctest:4,action:4,chang:2,mailman_media:[],mock:0,contactpag:[],via:[],appli:[],app:[4,3],sponser:[],foundat:3,releas:2,api:3,sponsel:[],foord:0,home:[],instal:[1,2,3,4],myownunittest:0,middlewar:[],from:[0,4,2],describ:4,would:[],commun:[],doubl:4,two:[],perm:[],next:[],websit:[],few:[],call:3,typo:3,recommend:[],dict:0,type:4,web_host:4,create_mock_list:0,mailman_django:[],abspath:[],relat:4,ital:[],site:[4,2],warn:[4,2],trail:[],berlio:[],stick:[],autodoc:[],particular:3,dooo:[],hold:[],unpack:[],easiest:4,dot:0,customlog:[],account:[3,2],join:[],alia:2,prepar:2,work:[],uniqu:[],dev:[3,2],itself:[],can:[0,4,2,3],purpos:3,def:[],control:[],defer:3,sqlite:2,prompt:2,login_requir:4,tar:[],process:3,sudo:2,accept:3,topic:[],want:[4,2],create_mock_memb:0,create_mock_domain:0,nearli:[],alwai:2,cours:[],multipl:[],listmembersviewtest:0,anoth:4,faulti:[],georg:4,write:[],how:2,list_nam:0,reject:3,instead:4,config:[],nasti:[],css:2,updat:4,product:2,resourc:4,farm:3,pypi:2,after:[4,2],"long":[],usabl:[],befor:4,wrong:4,mai:[],end:[],data:4,third:2,postfix:[],bind:[],bootstrap:[],credenti:[],django:[0,4,2,3],alias:3,environ:2,adverrtis:4,jain:3,enter:4,fallback:[],automaticli:[],egg:[],order:2,listnam:4,help:[],move:3,becaus:4,has_perm:[],"__future__":[],style:[],directli:4,fit:3,fix:3,browserid:3,unicode_liter:[],better:[],restart:[],onc:[],mail:[0,4,3],hidden:[],main:[],might:[],guarente:[],split:[],them:[0,2],good:[],"return":[],thei:4,python:[0,4,2],databs:[],auth:[],unfortuneatli:[],"break":[],mention:4,front:4,retreiv:0,now:[4,2,3],term:3,benst:[],somewher:2,name:[0,4],anyth:[],edit:[4,3],simpl:[],postorius_error:[],authent:[],separ:[4,3],easili:[],senarclen:3,each:4,debug:4,found:[4,2],went:4,mailman_test_bindir:[],everyth:4,domain:[0,4,3],replac:[],idea:[],procedur:[],realli:4,redistribut:3,meta:4,"static":2,connect:3,our:4,patch:[],todo:[],dependeci:[],out:3,variabl:[],shown:4,space:3,miss:3,robert:2,develop:[0,1,2,3,4],publish:3,api_us:4,profil:3,daniel:3,rest_serv:[],got:[],correct:2,earlier:[],insid:[],free:[4,3],standalon:[],reason:[],base:[],mailmanweb:[],lists_of_domain:[],put:0,org:[0,3,2],restbackend:[],"40mail":4,launch:[],could:[],latest:2,membership:[0,4],keep:2,filter:[],thing:4,place:[],isn:[],root_urlconf:[],requireti:[],summari:4,first:[4,2],softwar:3,rang:[],render:[],prevent:[],feel:4,media_root:[],natti:[],restrict:4,date:2,instruct:[4,2],alreadi:4,done:4,messag:[4,3],authentif:4,owner:4,stabl:4,installed_app:[],open:4,gpl:[],differ:2,rrze:[],my_own_test:0,benedict:3,hardcopi:[],licens:3,system:[],least:4,url_host:0,too:0,licenc:[],fullfil:[],"final":4,store:[],shell:4,option:4,real_nam:4,copi:3,specifi:4,gsoc:[],"var":[],part:4,"__test__":0,exactli:[],priveledg:[],serv:2,test_some_method:[],provid:[4,2,3],remov:[4,3],new_domain:[],project:[0,3,2],postorius_standalon:2,were:4,posit:4,minut:[],other:4,fqdn_listnam:[0,4],pre:[],sai:[],runner:0,ani:3,postorius_access:[],packag:2,have:[4,2,3],tabl:2,need:[4,2],element:[],wsgiscriptalia:2,engin:2,inform:2,florian:[],destroi:[],self:[],note:[4,2],also:2,exampl:[0,4],take:[],indic:4,combin:[],mock_memb:0,singl:4,even:3,sure:[0,4,2],kati:4,allow:[4,2],httpredirectobject:4,usernam:[],object:[0,4],asdasd:[],most:4,plan:[],letter:4,watt:4,alpha:3,"class":[],icon:[],collectstat:2,don:4,bzr:2,url:4,doc:[],later:[],cover:2,temporili:4,doe:4,deni:2,pars:4,usual:[],dev_setup:[],wsgi:2,show:[4,3],text:4,contact_address:0,session:4,permiss:4,corner:[],fine:[],find:0,magicmock:0,redirect:4,absolut:[],onli:[4,2],eas:[],locat:2,launchpad:2,copyright:3,explain:4,configur:[],apach:[3,2],should:[0,4,2,3],version:[3,2],suppos:[],templat:3,folder:[0,2],local:[4,2],hope:3,media_url:[],hit:[],contribut:3,get:[4,2],"__file__":[],stop:4,obviou:[],absolute_import:[],csrf:3,subscript:4,requir:4,mail_host:[0,4],bar:[],template_dir:[],"public":3,reload:2,bad:[],common:[],restadmin:[],mm_membership:4,where:0,view:[4,3],wiki:[],conform:3,set:[0,4,2,3],special:[],sometest:[],see:[4,2,3],domain_admin:[],result:[],respons:4,testcas:[],wonder:[],awar:4,statu:4,mailman3a7:[],correctli:[],databas:[4,2],someth:4,test_list_memb:0,behind:[],quickest:2,between:4,"import":[0,4],awai:[],email:4,realnam:[],extens:[],correclti:[],advertis:4,subfold:[],thank:3,both:[],last:4,plugin:[],admin:2,howev:[],etc:2,instanc:4,context:[],delete_list:4,logout:[],login:[4,3],com:4,load:4,english:4,simpli:4,point:[],instanti:[],overview:4,unittest:[],address:[0,4],virtualhost:2,mock_list:0,header:[],featur:[],non:[],shortcut:0,linux:4,guid:[4,2],assum:2,backend:[],quit:[],trunk:[],mailman:[0,1,2,3,4],coupl:4,"0a7":[],been:4,compon:[],much:[],unsubscrib:[4,3],modif:[],addit:[],quickli:0,upcom:[],imag:2,xxx:[],togeth:4,i18n:[],ngeorg:4,niederreit:2,those:4,"case":4,creativecommon:[],therefor:[],look:[],gnu:[3,2],plain:[],align:[],properti:0,lesser:3,"while":2,dashboard:4,publicli:2,error:3,everyon:[],authentication_backend:[],new_list:[],helper:3,almost:2,demo:[],metric:3,list_own:4,archiv:4,revis:[],"__init__":0,subscrib:[4,3],decor:4,let:4,welcom:[],author:[],receiv:3,media:[],make:[0,4,2],belong:4,same:4,member:[0,3],handl:[],html:[],gui:4,document:[3,2],mod_wsgi:[3,2],behav:0,finish:4,http:[4,2,3],webserv:2,upon:[],effect:[],moment:[],http_host:4,initi:3,mani:3,implement:3,expand:[],appropri:[],moder:3,scenario:[],framework:[],api_pass:4,well:[4,2],membership_set:[],pep8:3,client:[0,4,2],command:[],thi:[0,4,2,3],choos:4,fail:[4,3],left:[],summer:3,just:2,rest:4,mailman3:4,webui:[],test_util:0,yet:[],languag:4,web:[1,2,3],display_nam:0,easi:[],project_path:[],had:[],list_summari:4,littl:0,apache2:[],add:[0,4,3],valid:4,lawrenc:[],save:[],modul:[0,4],build:[],bin:[],applic:2,which:[4,2],stein:3,unter:[],read:[],prefer:2,testlist:0,test:[0,4,3],know:2,gsoc_mailman:[],press:4,cooki:[],bit:0,password:[],tweak:[],authbackend:[],like:0,resid:[0,2],template_context_processor:[],success:[4,3],changelog:[1,3],restpass:[],server:[3,2],collect:2,href:[],setup_mm:4,either:4,page:4,www:[0,3],right:[],acknowledg:[],creation:4,some:[0,4],back:[],proper:3,create_list:[],funcit:[],librari:0,distribut:3,basic:3,buildout:2,djangoproject:[],confirm:4,avoid:[],woun:[],token:3,select:[],slash:[],necessari:2,foo:[],anna:3,refer:4,machin:4,core:[],who:[],run:[0,4,2],bold:[],symlink:[],host:[],repositori:[],post:4,bazaar:2,mm_new_domain:[],stage:[],src:0,about:[],central:[],usa:4,mass_subscrib:4,rohan:3,side:[],permission_requir:[],srv:2,act:2,fals:4,discard:3,readi:2,processor:[],block:4,own:[0,4],addus:[],status_cod:4,pythonpath:2,xyz:[],within:4,someviewclass:[],easy_instal:2,warranti:3,creativ:[],empti:4,contrib:[],your:[0,2],manag:[0,4,2],choosen:4,span:4,log:4,wai:[4,2],"40exampl":4,execut:4,print:[0,4],submit:4,custom:[],avail:[4,2],start:[4,2],reli:[],interfac:[3,2],includ:4,suit:4,superus:2,systers_django:[],"function":4,head:[],form:[4,3],offer:4,descrip:[],requestfactori:[],link:4,translat:4,teardown_mm:4,branch:[3,2],line:[4,2],"true":4,info:3,pull:2,succe:4,made:4,render_mailman_them:[],bullet:[],possibl:2,whether:4,access:[4,3],displai:4,below:4,memebership:[],otherwis:[],more:3,postmast:0,extend_ajax:[],proud:[],creat:[0,4,2],hardcod:[],dure:[4,3],doesn:[],listsettingsviewtest:0,exist:[],file:[3,2],syncdb:2,pip:2,wackerbarth:3,check:[4,3],acl:[],again:[],coder:2,successfulli:[],googl:3,titl:[],user:[0,4,2,3],when:[],detail:[3,2],gettext:4,"default":[],mizyrycki:3,mock_list2:[],futur:[],rememb:[],writabl:2,you:[0,4,2,3],servernam:[],nice:4,michael:0,why:4,prequir:[],consid:[],stai:[],outdat:4,sphinx:[],mock_domain:0,directori:[0,4,2],enjoi:4,bottom:[],descript:[0,4],rule:[],mailman_them:[],mass:[4,3],came:[],time:[4,2],escap:4,inc:3},objtypes:{"0":"py:module"},titles:["Development","Postorius - The New Mailman Web UI","Installation","News / Changelog","Using the Django App - Developers Resource (outdated)"],objnames:{"0":["py","module","Python module"]},filenames:["development","index","setup","news","using"]}) \ No newline at end of file diff --git a/src/postorius/doc/_build/html/setup.html b/src/postorius/doc/_build/html/setup.html index 0b17052..b2b4666 100644 --- a/src/postorius/doc/_build/html/setup.html +++ b/src/postorius/doc/_build/html/setup.html @@ -37,9 +37,6 @@ index
  • - modules |
  • -
  • next |
  • @@ -239,9 +236,6 @@ index
  • - modules |
  • -
  • next |
  • @@ -252,7 +246,7 @@ \ No newline at end of file diff --git a/src/postorius/doc/_build/html/using.html b/src/postorius/doc/_build/html/using.html index ce027e5..3d4829b 100644 --- a/src/postorius/doc/_build/html/using.html +++ b/src/postorius/doc/_build/html/using.html @@ -25,8 +25,7 @@ - - +
  • modules |
  • -
  • - previous |
  • Postorius 1.0a2 documentation »
  • @@ -364,9 +360,6 @@ -

    Previous topic

    -

    Installation

    This Page

    diff --git a/src/postorius/doc/conf.py b/src/postorius/doc/conf.py index c33b635..d308e7c 100644 --- a/src/postorius/doc/conf.py +++ b/src/postorius/doc/conf.py @@ -13,6 +13,9 @@ import sys, os +# add dummy settings environment variable so sphinx can import from Postorius. +os.environ['DJANGO_SETTINGS_MODULE'] = 'postorius.doc.settings' + #import the source code directory into Python Path for use with Auto Module APP_ROOT = os.path.dirname(__file__) sys.path.insert(0, os.path.split(APP_ROOT)[0]) diff --git a/src/postorius/doc/development.rst b/src/postorius/doc/development.rst index 45efe00..9cdad7e 100644 --- a/src/postorius/doc/development.rst +++ b/src/postorius/doc/development.rst @@ -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/settings.py b/src/postorius/doc/settings.py new file mode 100755 index 0000000..a7e4dd1 --- /dev/null +++ b/src/postorius/doc/settings.py @@ -0,0 +1,20 @@ +#-*- coding: utf-8 -*- +# Copyright (C) 1998-2012 by the Free Software Foundation, Inc. +# +# This file is part of Postorius. +# +# Postorius is free software: you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation, either version 3 of the License, or (at your option) +# any later version. +# +# Postorius is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along with +# Postorius. If not, see . + +"""This is just an empty settings file to make Sphinx able to export +the DJANGO_SETTINGS_MODULE env variable before building the docs.""" diff --git a/src/postorius/tests/test_utils.py b/src/postorius/tests/test_utils.py index 738acca..311104c 100644 --- a/src/postorius/tests/test_utils.py +++ b/src/postorius/tests/test_utils.py @@ -26,7 +26,7 @@ Domains ======= -``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', diff --git a/src/postorius/tests/utils.py b/src/postorius/tests/utils.py index 7dc7a4c..7a157ef 100644 --- a/src/postorius/tests/utils.py +++ b/src/postorius/tests/utils.py @@ -48,6 +48,7 @@ :rtype: MagicMock """ mock_object = MagicMock(name='List') + # like in mock_domain, some defaults need to be added... if properties is not None: for key in properties: setattr(mock_object, key, properties[key]) @@ -63,6 +64,7 @@ :rtype: MagicMock """ mock_object = MagicMock(name='Member') + # like in mock_domain, some defaults need to be added... if properties is not None: for key in properties: setattr(mock_object, key, properties[key])