diff --git a/doc/_build/doctrees/acknowledgements.doctree b/doc/_build/doctrees/acknowledgements.doctree index 8a1b47a..b038c50 100644 --- a/doc/_build/doctrees/acknowledgements.doctree +++ b/doc/_build/doctrees/acknowledgements.doctree Binary files differ diff --git a/doc/_build/doctrees/environment.pickle b/doc/_build/doctrees/environment.pickle index 8b32899..d3c56de 100644 --- a/doc/_build/doctrees/environment.pickle +++ b/doc/_build/doctrees/environment.pickle Binary files differ diff --git a/doc/_build/doctrees/using.doctree b/doc/_build/doctrees/using.doctree index 91190d6..c4f9a1c 100644 --- a/doc/_build/doctrees/using.doctree +++ b/doc/_build/doctrees/using.doctree Binary files differ diff --git a/doc/_build/html/_sources/acknowledgements.txt b/doc/_build/html/_sources/acknowledgements.txt index f4384f2..4abdd73 100644 --- a/doc/_build/html/_sources/acknowledgements.txt +++ b/doc/_build/html/_sources/acknowledgements.txt @@ -19,7 +19,14 @@ ACL --- -* Middleware ... +* Middleware + + We don't have the Middleware which is required to work with users and it's permissions yet. For this reason we had to tweak some functions to be a hardcoded Demo object. + + * Login Check + At the moment we're using a hardcoded List of allowed usernames and Passwords which are all stored in Plain within the AuthBackends Source File. + * has_perm Decorator + As we don't have a middleware to check for users and it's permissions we do only use one permission at the moment. The permission site domain_admin is hardcoded to user.username == "james@example.com" diff --git a/doc/_build/html/acknowledgements.html b/doc/_build/html/acknowledgements.html index aef3c84..61c9bd2 100644 --- a/doc/_build/html/acknowledgements.html +++ b/doc/_build/html/acknowledgements.html @@ -76,8 +76,26 @@

ACL

-
diff --git a/doc/_build/html/index.html b/doc/_build/html/index.html index c84ed86..a82f010 100644 --- a/doc/_build/html/index.html +++ b/doc/_build/html/index.html @@ -61,7 +61,8 @@
  • Using the Django App - Developers Resource diff --git a/doc/_build/html/searchindex.js b/doc/_build/html/searchindex.js index bd398b8..bcf7c9b 100644 --- a/doc/_build/html/searchindex.js +++ b/doc/_build/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({objects:{tests:{tests:[4,0,0]}},terms:{all:[4,1,2],code:[4,1],prefil:4,four:4,kati:4,runserv:1,dirnam:1,follow:[4,1],decid:[4,1],under:3,introduc:1,merchant:3,everi:1,string:4,far:[4,1],offlin:1,util:4,context_processor:1,mechan:4,exact:4,special:[4,1,3],contenttyp:1,administr:4,level:1,did:4,button:4,list:[4,2],"try":4,item:[],adjust:1,httpredirectobject:4,quick:1,setup:[4,1],dir:1,pleas:[4,1,3],modelbackend:1,impli:3,httpresponseredirect:4,cfg:[],seper:[4,1],past:1,second:1,download:1,further:[],compat:1,index:4,what:4,appear:[4,1],sum:[],abl:1,current:[4,3],delet:[4,2],version:[1,3],franziska:3,"new":4,net:1,"public":3,gener:3,remeb:1,here:[4,1,3],themself:4,ubuntu:1,path:1,along:3,modifi:[4,1,3],sinc:[],valu:[4,1],search:0,vertifi:1,anymor:1,jame:4,doctest:4,action:4,chang:[4,1,2],mailman_media:1,contactpag:2,via:[],appli:1,app:[0,1,4],sponser:2,foundat:3,api:[0,1],sponsel:3,instal:[0,1,4],middlewar:[4,1,2],from:[4,1,2],describ:4,would:1,commun:1,doubl:4,perm:[],next:[4,1],websit:[1,3],few:[4,1],call:[4,1],recommend:1,type:4,web_host:4,mailman_django:[0,1],abspath:1,ital:[],site:[0,1,4],trail:1,berlio:3,stick:1,particular:3,hold:1,unpack:1,easiest:4,account:4,join:1,prepar:1,work:[4,1],dev:4,itself:1,can:[4,1,2,3],purpos:3,login_requir:4,tar:1,sudo:1,templat:1,topic:4,want:[4,1],contribut:[0,3],cours:1,end:[4,1],faulti:4,georg:4,write:4,how:[],instead:[4,1],config:1,css:1,updat:1,resourc:[0,4],after:[4,1],usabl:[],befor:[4,1],wrong:4,authentif:[4,1],data:1,postfix:1,bind:1,bootstrap:1,django:[0,1,4],inform:[4,3],allow:[4,1],fallback:1,automaticli:4,egg:1,order:4,listnam:4,help:[],becaus:4,style:1,directli:4,fit:3,better:1,requir:[4,1],onc:[4,1],mail:4,hidden:1,main:[],might:1,guarente:1,split:1,them:1,"return":4,thei:4,python:[4,1],auth:[4,1],unfortuneatli:4,mention:1,front:4,now:[4,1],term:3,benst:1,somewher:1,name:[4,1],anyth:2,edit:4,simpl:[4,1],authent:4,separ:4,easili:1,each:4,debug:[4,1],found:3,went:4,mailman_test_bindir:1,domain:[4,2],replac:[],idea:[0,2],procedur:4,realli:[4,1],redistribut:3,"static":[],connect:[4,1],our:[4,1,3],todo:[4,2],dependeci:1,logout:4,space:[],miss:[0,2],develop:[0,1,2,4],publish:3,api_us:[4,1],content:[0,1,4],rest_serv:1,got:[4,1],correct:4,earlier:1,free:[4,1,2,3],cooki:[],reason:[4,1],base:1,mailmanweb:[],lists_of_domain:1,put:1,org:3,"40mail":4,launch:1,could:[1,3],membership:4,keep:1,thing:[4,1],place:[4,1],root_urlconf:1,requireti:[],summari:4,first:[4,1],softwar:3,rang:[],render:1,feel:[4,1,2],media_root:1,natti:1,restrict:4,instruct:4,alreadi:[4,1],done:[4,1],least:4,stabl:[4,1],installed_app:1,open:4,gpl:[0,3],differ:1,rrze:[0,3],hardcopi:1,licens:[0,3],system:1,messag:[4,1],licenc:3,fullfil:1,"final":4,store:4,shell:[4,1],option:[4,1,3],real_nam:4,copi:[1,3],specifi:[],gsoc:1,part:[4,1,3],mm_membership:4,priveledg:1,serv:1,enjoi:4,provid:[4,2],new_domain:4,project:[1,3],were:1,posit:4,fqdn_listnam:4,pre:4,ani:[1,3],packag:1,have:[4,1,3],tabl:1,need:[4,1],element:1,florian:1,destroi:1,client:[0,1,4],note:[4,1],without:[4,3],take:4,indic:4,singl:4,even:3,sure:[4,1],distribut:3,shall:4,usernam:[4,1],object:4,plan:[4,1],letter:4,watt:4,"class":[4,1],icon:[0,3],don:1,bzr:1,url:[4,1],doc:4,later:[4,1,3],hardcod:4,temporili:4,doe:4,pars:4,left:4,came:4,show:2,text:[4,3],liza:4,session:[4,1],permiss:[4,1],corner:4,fine:1,eas:1,redirect:4,absolut:1,onli:[4,1],locat:4,launchpad:1,copyright:3,explain:[0,4],configur:1,should:[4,1,3],new_list1:4,suppos:1,hope:3,media_url:1,nearli:1,get:[4,1],"__file__":1,stop:4,csrf:1,subscript:4,restart:1,template_dir:1,whether:4,common:3,restadmin:1,where:1,view:[4,1],set:[0,1,3,4],see:[4,1,3],domain_admin:4,result:1,respons:4,fail:[4,1],wonder:4,awar:[4,1],statu:4,mailman3a7:1,databas:4,someth:4,between:[4,1],"import":4,awai:1,email:4,realnam:4,correclti:1,advertis:4,subfold:1,addit:[4,3],both:[4,1],last:4,plugin:1,admin:1,howev:1,instanc:4,context:[4,1],delete_list:4,modif:1,login:[4,1],com:[4,1],load:4,simpli:[4,1,2],point:1,instanti:[],address:[4,1],header:[],non:1,linux:4,backend:[4,1],mailman:[0,1,3,4],coupl:1,"0a7":1,been:4,compon:1,much:1,unsubscrib:4,subscrib:[4,2],upcom:1,xxx:2,togeth:[4,1],i18n:1,ngeorg:4,those:1,"case":[4,1],creativecommon:3,therefor:4,look:4,gnu:3,align:1,abov:[0,4],mail_host:4,everyon:1,authentication_backend:1,new_list:4,list_own:4,archiv:4,revis:1,decor:[4,1],let:4,welcom:0,author:[],receiv:3,media:1,make:[4,1],same:[4,1],handl:[4,1],html:[1,3],gui:4,document:[0,4],finish:4,http:[4,1,3],upon:4,moment:[4,1],http_host:4,user:[4,1,2],implement:[4,2],expand:4,appropri:1,framework:[],api_pass:[4,1],usual:1,well:[4,1],membership_set:4,exampl:[4,1],command:1,thi:[4,1,3],english:4,everyth:[4,1],latest:1,just:1,rest:[0,1,2,4],mailman3:[0,1,2,4],webui:[4,1],restbackend:[4,1],languag:4,easi:1,project_path:1,had:4,list_summari:4,add:[4,1],lawrenc:1,save:[],modul:[4,1],bin:1,applic:[0,1],which:[4,1,2],unter:[0,3],know:1,gsoc_mailman:1,press:4,password:[4,1],mailmanwebgsoc2011:1,like:[1,2],template_context_processor:1,success:4,restpass:1,server:[0,1,2],href:4,setup_mm:4,either:[4,3],page:[0,1,4],www:[1,3],right:[4,1],acknowledg:[0,2,4],creation:4,some:[4,1],home:1,successfulli:1,buildout:1,djangoproject:[4,1],confirm:4,woun:1,thank:3,select:4,slash:1,testobject:4,localhost:[4,1],refer:4,machin:4,core:1,run:[0,1,4],bold:[],symlink:1,step:1,repositori:1,post:4,mm_new_domain:4,stage:[],about:[1,3],central:[],usa:4,mass_subscrib:4,acl:[0,2,4],act:4,fals:4,processor:1,block:4,own:[4,1],addus:4,status_cod:4,within:[4,1],warranti:3,creativ:3,empti:4,contrib:1,your:[4,1,3],manag:[4,1],log:4,wai:4,"40exampl":4,execut:4,print:4,"long":1,custom:1,avail:[4,1],start:[4,1],includ:[4,1],suit:4,systers_django:[],"function":[0,1,2,4],head:4,form:4,descrip:1,link:[4,1],translat:4,teardown_mm:4,line:4,"true":4,succe:4,made:[4,1],render_mailman_them:1,possibl:1,"default":1,access:[0,1,4],displai:4,below:4,memebership:4,otherwis:1,more:[4,3],extend_ajax:1,proud:2,creat:[4,1,3],request:4,dure:1,exist:[4,1],file:[4,1,3],syncdb:1,check:[4,1],inc:3,again:[4,1],titl:[],when:1,detail:3,gettext:4,other:[4,1],futur:1,branch:1,test:[0,1,2,4],you:[4,1,2,3],why:4,consid:1,stai:4,bullet:[],directori:[4,1],bottom:4,descript:4,mailman_them:1,mass:4,time:[1,2],escap:4},objtypes:{"0":"py:module"},titles:["Welcome to mailman_django’s documentation!","Installation","Acknowledgements","Contributions:","Using the Django App - Developers Resource"],objnames:{"0":"Python module"},filenames:["index","setup","acknowledgements","license","using"]}) \ No newline at end of file +Search.setIndex({objects:{tests:{tests:[4,0,0]}},terms:{all:[4,1,2],code:[4,1],prefil:4,four:[],ackownledg:4,runserv:1,dirnam:1,follow:[4,1],decid:[4,1],authoris:4,send:4,under:3,introduc:1,merchant:3,sourc:2,everi:1,string:4,far:[4,1],offlin:1,util:4,context_processor:1,mechan:4,exact:4,contenttyp:1,administr:4,level:1,did:4,button:4,list:[4,2],"try":4,item:4,adjust:1,httpredirectobject:4,quick:1,setup:[4,1],dir:1,pleas:[4,1,3],modelbackend:1,impli:3,httpresponseredirect:4,cfg:[],seper:[4,1],request:4,past:1,second:1,download:1,further:[],click:4,compat:1,index:4,what:4,name_of_permiss:4,appear:1,sum:[],abl:[4,1],current:[4,3],delet:[4,2],new_list1:4,franziska:3,"new":4,net:1,"public":3,gener:3,remeb:1,here:[4,1,3],themself:4,ubuntu:1,path:1,along:3,modifi:[4,1,3],sinc:[],valu:[4,1],search:0,mailinglist:4,vertifi:1,anymor:1,step:1,jame:[4,2],doctest:4,action:4,chang:[4,1,2],mailman_media:1,contactpag:2,via:4,appli:1,app:[0,1,4],sponser:2,foundat:3,api:[0,1],sponsel:3,instal:[0,1,4],middlewar:[4,1,2],from:[4,1,2],describ:4,would:1,commun:1,doubl:4,two:4,perm:[],next:[4,1],websit:[1,3],few:[4,1],call:[4,1],recommend:1,type:4,web_host:4,mailman_django:[0,1],abspath:1,relat:4,ital:[],site:[0,1,2,4],trail:1,berlio:3,stick:1,particular:3,hold:1,unpack:1,easiest:4,dependeci:1,account:4,join:1,prepar:1,work:[4,1,2],uniqu:4,dev:4,itself:1,can:[4,1,2,3],purpos:3,login_requir:4,tar:1,sudo:1,templat:1,topic:4,want:[4,1],nearli:1,cours:1,multipl:4,faulti:4,georg:4,write:4,how:[],instead:[4,1],config:1,css:1,updat:1,resourc:[0,4],after:[4,1],"long":1,usabl:[],befor:[4,1],wrong:4,mai:4,end:1,data:[4,1],postfix:1,bind:1,bootstrap:1,django:[0,1,4],inform:[4,3],adverrtis:4,allow:[4,1,2],enter:4,fallback:1,automaticli:4,egg:1,order:4,listnam:4,help:[],becaus:4,has_perm:2,style:1,directli:4,fit:3,better:1,restart:1,onc:[4,1],mail:4,hidden:1,main:4,might:1,guarente:1,split:1,them:1,"return":4,thei:4,python:[4,1],auth:[4,1],unfortuneatli:4,mention:[4,1],front:4,now:[4,1],term:3,benst:1,somewher:1,name:[4,1],anyth:2,edit:4,simpl:[4,1],authent:4,separ:4,easili:1,each:4,debug:[4,1],found:3,went:4,mailman_test_bindir:1,domain:[4,2],replac:[],idea:[0,2],procedur:4,realli:[4,1],redistribut:3,meta:4,"static":[],connect:[4,1],our:[4,1,3],todo:[4,2],special:[4,1,3],shown:4,space:[],miss:[0,2],develop:[0,1,2,4],publish:3,api_us:[4,1],content:[0,1,4],rest_serv:1,got:[4,1],correct:4,earlier:[4,1],free:[4,1,2,3],cooki:[],reason:[4,1,2],base:1,mailmanweb:[],lists_of_domain:1,put:1,org:3,"40mail":4,launch:1,could:[4,1,3],membership:4,keep:1,filter:4,thing:[4,1],place:[4,1],isn:4,root_urlconf:1,requireti:[],summari:4,first:[4,1],softwar:3,rang:[],render:1,feel:[4,1,2],media_root:1,natti:1,restrict:4,instruct:4,alreadi:[4,1],done:[4,1],least:4,authentif:[4,1],owner:4,stabl:[4,1],installed_app:1,open:4,gpl:[0,3],differ:1,rrze:[0,3],hardcopi:1,licens:[0,3],system:1,messag:[4,1],licenc:3,fullfil:1,"final":4,store:[4,2],shell:[4,1],option:[4,1,3],real_nam:4,copi:[1,3],specifi:4,gsoc:1,part:[4,1,3],pars:4,priveledg:1,serv:1,enjoi:4,provid:[4,2],new_domain:[],project:[1,3],were:[4,1],posit:4,fqdn_listnam:4,pre:4,ani:[1,3],packag:1,have:[4,1,2,3],tabl:1,need:[4,1],element:1,florian:1,destroi:1,client:[0,1,4],note:[4,1],without:[4,3],take:4,indic:4,singl:4,even:3,sure:[4,1],kati:4,distribut:3,shall:4,usernam:[4,1,2],object:[4,2],most:4,plan:[4,1],letter:4,watt:4,"class":[4,1],icon:[0,3],don:[1,2],bzr:1,url:[4,1],doc:4,later:[4,1,3],hardcod:[4,2],temporili:4,doe:4,mm_membership:4,left:4,came:4,show:[4,2],text:[4,3],liza:4,session:[4,1],permiss:[0,1,2,4],corner:4,fine:1,eas:1,redirect:4,absolut:1,onli:[4,1,2],locat:4,launchpad:1,copyright:3,explain:[0,4],configur:[4,1],should:[4,1,3],version:[1,3],suppos:1,local:4,hope:3,media_url:1,contribut:[0,3],get:[4,1],"__file__":1,stop:4,obviou:4,csrf:1,subscript:4,requir:[4,1,2],template_dir:1,whether:4,common:3,restadmin:1,where:1,view:[4,1],set:[0,1,3,4],see:[4,1,3],domain_admin:2,result:1,respons:4,fail:[4,1],wonder:4,awar:[4,1],statu:4,mailman3a7:1,correctli:4,databas:4,someth:4,restbackend:[4,1],behind:4,between:[4,1],"import":4,awai:1,email:4,realnam:[],correclti:[4,1],advertis:4,subfold:1,addit:[4,3],both:[4,1],last:4,plugin:1,admin:1,howev:1,etc:4,instanc:4,context:[4,1],delete_list:4,logout:4,login:[0,1,2,4],com:[4,1,2],load:4,english:4,simpli:[4,1,2],point:1,instanti:[],overview:4,address:[4,1],header:[],non:1,linux:4,backend:[4,1],mailman:[0,1,3,4],coupl:1,"0a7":1,been:4,compon:1,much:1,unsubscrib:4,modif:1,upcom:1,xxx:2,togeth:[4,1],i18n:1,ngeorg:4,those:[4,1],"case":[4,1],creativecommon:3,therefor:4,look:4,gnu:3,plain:2,align:1,dashboard:4,abov:[0,4],mail_host:4,everyon:1,authentication_backend:1,new_list:[],demo:2,list_own:4,archiv:4,revis:1,subscrib:[4,2],decor:[4,1,2],let:4,welcom:0,author:[],receiv:3,media:1,make:[4,1],belong:4,same:[4,1],handl:[4,1],html:[1,3],gui:4,document:[0,4],finish:4,http:[4,1,3],upon:4,moment:[4,1,2],http_host:4,user:[4,1,2],implement:[4,2],expand:4,appropri:1,framework:[],api_pass:[4,1],usual:1,well:[4,1],membership_set:4,exampl:[4,1,2],command:1,thi:[4,1,2,3],choos:4,everyth:[4,1],latest:1,just:1,rest:[0,1,2,4],mailman3:[0,1,2,4],webui:[4,1],yet:2,languag:4,easi:1,project_path:1,had:[4,2],list_summari:4,mailmanwebgsoc2011:1,add:[4,1],other:[4,1],lawrenc:1,save:[],modul:[4,1],bin:1,applic:[0,1],which:[4,1,2],unter:[0,3],know:1,gsoc_mailman:1,press:4,password:[4,1,2],tweak:2,authbackend:2,like:[4,1,2],template_context_processor:1,success:4,restpass:1,server:[0,1,2],href:4,setup_mm:4,either:[4,3],page:[0,1,4],www:[1,3],right:[4,1],acknowledg:[0,2,4],creation:4,some:[4,1,2],home:1,funcit:[],buildout:1,djangoproject:[4,1],confirm:4,woun:1,thank:3,select:4,slash:1,necessari:4,testobject:4,localhost:[4,1],refer:4,machin:4,core:1,who:4,run:[0,1,4],bold:[],symlink:1,host:4,repositori:1,post:4,mm_new_domain:4,stage:[],about:[1,3],central:[],usa:4,mass_subscrib:4,acl:[0,2],permission_requir:4,act:4,fals:4,processor:1,block:4,own:[4,1],addus:4,status_cod:4,within:[4,1,2],warranti:3,creativ:3,empti:4,contrib:1,your:[4,1,3],manag:[4,1],choosen:4,log:4,wai:4,"40exampl":4,execut:4,print:4,submit:4,custom:1,avail:[4,1],start:[4,1],includ:[4,1],suit:4,systers_django:[],"function":[0,1,2,4],head:4,form:4,offer:4,descrip:1,link:[4,1],translat:4,teardown_mm:4,branch:1,line:4,"true":4,succe:4,made:[4,1],render_mailman_them:1,possibl:1,"default":1,access:[0,1,4],displai:4,below:4,memebership:4,otherwis:1,more:[4,3],extend_ajax:1,proud:2,creat:[4,1,3],cover:4,dure:[4,1],doesn:4,exist:1,file:[4,1,2,3],syncdb:1,check:[4,1,2],inc:3,again:[4,1],successfulli:1,titl:[],when:[4,1],detail:3,gettext:4,valid:4,futur:1,rememb:4,test:[0,1,2,4],you:[4,1,2,3],nice:4,why:4,prequir:4,consid:1,stai:4,bullet:[],directori:[4,1],bottom:4,descript:4,mailman_them:1,mass:4,time:[4,1,2],escap:4},objtypes:{"0":"py:module"},titles:["Welcome to mailman_django’s documentation!","Installation","Acknowledgements","Contributions:","Using the Django App - Developers Resource"],objnames:{"0":"Python module"},filenames:["index","setup","acknowledgements","license","using"]}) \ No newline at end of file diff --git a/doc/_build/html/using.html b/doc/_build/html/using.html index 24b8d05..c80d207 100644 --- a/doc/_build/html/using.html +++ b/doc/_build/html/using.html @@ -53,8 +53,8 @@

    Using the Django App - Developers Resource

    -
    -

    Functionality and Test

    +
    +

    Tests Login and Permissions

    This document both acts as a test for all the functions implemented in the UI as well as documenting what can be done

    @@ -154,58 +154,71 @@

    Permissions

    -

    Check that only James does have the permission to get the domains administration -#TODO - ACL is hardcoded in auth backend : permission domain_admin → == james@...

    +

    Our own Auth Backend allows the use of Djangos own Permission Decorator which is

    +
    @permission_required(NAME_OF_PERMISSION)
    +
    +

    At the moment we’ve installed this for Domain Administration,

    +
    +
    +

    Note

    +

    Please take a look at the ackownledgement to see what is working in this part

    +
    +
    +

    Get the Domains page and get redirected because Katie who is logged in doesn’t have the Permission

    >>> response = c.get('/domains/')
     >>> print type(response) == HttpResponseRedirect
     True
     
    +

    Logout Katie who isn’t a Domain-Owner and Login James who should be allowed to view this page

    >>> c.logout() #katie
    -
    -
    -
    >>> c.login(username='james@example.com', password='james') #now Domains should work - see tests below
    +>>> c.login(username='james@example.com', password='james')
     True
     
    +

    Check that the Page now loads correctly

    +
    >>> response = c.get('/domains/')
    +>>> response.status_code
    +200
    +
    +
    +
    +
    +

    Pages

    Create a New Domain

    -

    Check the content to see that we came to the create page after -logging in.

    +

    Domain Administration is called by opening the URL mentioned below. Prequirements like Authorisation and Permissions have been covered before. +Now we do check that the response really does have the correct heading.

    >>> response = c.get('/domains/')
    +>>> print "Domain Index" in response.content
    +True
    +
    +
    +

    On this page there should be a button which allows to create a new Domain. +If you’re running Mailman for the first time you need to create a Domain before creating Mailinglists. That’s only because each List is Part of a Domain and could not be created without it’s reference.

    +
    >>> '<li class="mm_new_domain"><a href="/domains/new/">New Domain</a></li>' in response.content
    +True
     
    -
    Then we check that everything went well.
    -
    >>> response.status_code
    -200
    ->>> print "Domain Index" in response.content #TODO - change heading
    -True
    -
    -
    -
    -
    Check the button which should allow creation of a new domains
    -
    >>> '<li class="mm_new_domain"><a href="/domains/new/">New Domain</a></li>' in response.content
    -True
    -
    -
    -
    -
    Now go to the Domains creation page
    +
    For sure the page allowing the creation of a new Domain should open correclty as well
    >>> response = c.get('/domains/new/')
    -
    -
    -
    -
    -

    Then we check that everything went well.

    -
    >>> response.status_code
    +>>> response.status_code
     200
     >>> print "Add a new Domain" in response.content #TODO - change heading
     True
     
    -

    and create a new Domain called ‘mail.example.com’. -Check that the new Domain exists in the list of existing domains which is above new_domain form

    + + +

    Each Domain has two main Data Parts, most obvious for a mailinglist we do need a mail_host that’s the part behind the @ when getting an email. In addition we offer you this WebUI for configuration, some may have multiple URLs they can use to access the same installation of mailman. For this reason each Mailinglist gets it’s own web_host as well - which doesn’t need to be unique.

    +

    Testing the Site we do now submit the form we’ve loaded earlier by sending all necessary data in a POST request. The new Domain will be called mail.example.com and available via it’s web_host example.com.

    +
    +
    +

    Note

    +

    If you do want to use web_host filtering in your webUI you need to remember adding the URL to your /etc/hosts - at least for development

    +
    >>> response = c.post('/domains/new/',
     ...                   {"mail_host": "mail.example.com",
     ...                    "web_host": "example.com",
    @@ -213,6 +226,7 @@
     >>> response = c.get('/domains/')
     
    +
    Then we check that everything went well.
    >>> response.status_code
    @@ -226,43 +240,24 @@
     

    Create a New List

    -
    -
    Try to access the list index
    -
    >>> response = c.get('/lists/')
    -
    -
    -
    -
    Then we check that everything went well.
    -
    >>> response.status_code
    +

    After creating a Domain you should be able to create new Lists. The Button for doing so is shown on the List index Page which should offer a list of all available (adverrtised) lists.

    +
    >>> response = c.get('/lists/')
    +>>> response.status_code
     200
    -
    -
    -
    >>> "All available Lists" in response.content
    +>>> "All available Lists" in response.content
     True
     
    -
    -
    -

    Try to create a new list. -And check the content to see that we came to the create page after -logging in.

    +

    The new List creation form is opened by clicking on the Button mentioned above or accessing the page directly

    >>> response = c.get('/lists/new/')
    -
    -
    -
    -
    Then we check that everything went well.
    -
    >>> response.status_code
    +>>> response.status_code
     200
    -
    -
    -
    >>> print "Create a new List on" in response.content
    +>>> print "Create a new List on" in response.content
     True
     
    -
    -
    -

    Now create a new list called ‘new_list’. -We should end up on a redirect

    +

    Creating a new List we do need to specify at least the below mentioned items. Those were entered using some nice GUI Forms which do only show up available Values or offer you to choose a name which will be checked during validation. +We’re now submitting the form using a POST request and get redirected to the List Index Page

    >>> response = c.post('/lists/new/',
     ...                   {"listname": "new_list1",
     ...                    "mail_host": "mail.example.com",
    @@ -274,46 +269,31 @@
     True
     
    -

    List index page should now include the realname of the list

    +

    As List index is an overview of all advertised Lists and we’ve choosen to do so we should now see our new List within the overview. HTTP_HOST is added as META Data for the request because we do only want to see Domains which belong to the example.com web_host

    >>> response = c.get('/lists/',HTTP_HOST='example.com')
    -
    -
    -
    -
    Then we check that everything went well.
    -
    >>> response.status_code
    +>>> response.status_code
     200
     >>> "New_list1" in response.content
     True
     
    -
    -

    List Summary

    -

    Four options appear on this page. The first one is to subscribe, -2. to view archives -3. to edit the list settings #at least if you do have permission to do so -4. to unsubscribe

    +

    List summary is a dashboard for each List. It does have Links to the most useful functions which are only related to that Domain. These include the Values mentioned below. _(function) is used to Translate these to you local language.

    >>> response = c.get('/lists/new_list1%40mail.example.com/',)    
    -
    -
    -
    -
    Then we check that everything went well.
    -
    >>> response.status_code
    +>>> response.status_code
     200
    ->>> "Subscribe" in response.content
    +>>> _("Subscribe") in response.content
     True
    ->>> "Archives" in response.content
    +>>> _("Archives") in response.content
     True
    ->>> "Edit Options" in response.content
    +>>> _("Edit Options") in response.content
     True
    ->>> "Unsubscribe" in response.content
    +>>> _("Unsubscribe") in response.content
     True
     
    -
    -

    Subscriptions

    @@ -499,12 +479,15 @@

    Table Of Contents

    • Using the Django App - Developers Resource
        -
      • Functionality and Test
          +
        • Tests Login and Permissions +
        • +
        • Pages
          • Create a New Domain
          • Create a New List
          • List Summary
          • diff --git a/doc/acknowledgements.rst b/doc/acknowledgements.rst index f4384f2..4abdd73 100644 --- a/doc/acknowledgements.rst +++ b/doc/acknowledgements.rst @@ -19,7 +19,14 @@ ACL --- -* Middleware ... +* Middleware + + We don't have the Middleware which is required to work with users and it's permissions yet. For this reason we had to tweak some functions to be a hardcoded Demo object. + + * Login Check + At the moment we're using a hardcoded List of allowed usernames and Passwords which are all stored in Plain within the AuthBackends Source File. + * has_perm Decorator + As we don't have a middleware to check for users and it's permissions we do only use one permission at the moment. The permission site domain_admin is hardcoded to user.username == "james@example.com" diff --git a/tests/tests.py b/tests/tests.py index ff81200..81ec3d1 100644 --- a/tests/tests.py +++ b/tests/tests.py @@ -18,7 +18,7 @@ """ ============================== -Functionality and Test +Tests Login and Permissions ============================== This document both acts as a test for all the functions implemented @@ -105,48 +105,72 @@ Permissions =========== -Check that only James does have the permission to get the domains administration -#TODO - ACL is hardcoded in auth backend : permission domain_admin → == james@... + +Our own Auth Backend allows the use of Djangos own Permission Decorator which is + +.. code-block:: python + + @permission_required(NAME_OF_PERMISSION) + +At the moment we've installed this for Domain Administration, + + .. note:: + Please take a look at the ackownledgement to see what is working in this part + +Get the Domains page and get redirected because Katie who is logged in doesn't have the Permission >>> response = c.get('/domains/') >>> print type(response) == HttpResponseRedirect True +Logout Katie who isn't a Domain-Owner and Login James who should be allowed to view this page + >>> c.logout() #katie - - >>> c.login(username='james@example.com', password='james') #now Domains should work - see tests below + >>> c.login(username='james@example.com', password='james') True + +Check that the Page now loads correctly + + >>> response = c.get('/domains/') + >>> response.status_code + 200 + + +===== +Pages +===== + Create a New Domain =================== -Check the content to see that we came to the create page after -logging in. + +Domain Administration is called by opening the URL mentioned below. Prequirements like Authorisation and Permissions have been covered before. +Now we do check that the response really does have the correct heading. >>> response = c.get('/domains/') - -Then we check that everything went well. - >>> response.status_code - 200 - >>> print "Domain Index" in response.content #TODO - change heading + >>> print "Domain Index" in response.content True -Check the button which should allow creation of a new domains +On this page there should be a button which allows to create a new Domain. +If you're running Mailman for the first time you need to create a Domain before creating Mailinglists. That's only because each List is Part of a Domain and could not be created without it's reference. + >>> '
          • New Domain
          • ' in response.content True -Now go to the Domains creation page +For sure the page allowing the creation of a new Domain should open correclty as well >>> response = c.get('/domains/new/') - -Then we check that everything went well. - >>> response.status_code 200 >>> print "Add a new Domain" in response.content #TODO - change heading True +Each Domain has two main Data Parts, most obvious for a mailinglist we do need a mail_host that's the part behind the @ when getting an email. In addition we offer you this WebUI for configuration, some may have multiple URLs they can use to access the same installation of mailman. For this reason each Mailinglist gets it's own web_host as well - which doesn't need to be unique. + +Testing the Site we do now submit the form we've loaded earlier by sending all necessary data in a POST request. The new Domain will be called mail.example.com and available via it's web_host example.com. + + .. note:: + If you do want to use web_host filtering in your webUI you need to remember adding the URL to your /etc/hosts - at least for development -and create a new Domain called 'mail.example.com'. -Check that the new Domain exists in the list of existing domains which is above new_domain form >>> response = c.post('/domains/new/', ... {"mail_host": "mail.example.com", ... "web_host": "example.com", @@ -162,31 +186,25 @@ Create a New List ================= -Try to access the list index +After creating a Domain you should be able to create new Lists. The Button for doing so is shown on the List index Page which should offer a list of all available (adverrtised) lists. + >>> response = c.get('/lists/') - -Then we check that everything went well. >>> response.status_code 200 - >>> "All available Lists" in response.content True -Try to create a new list. -And check the content to see that we came to the create page after -logging in. +The new List creation form is opened by clicking on the Button mentioned above or accessing the page directly >>> response = c.get('/lists/new/') - -Then we check that everything went well. >>> response.status_code 200 - >>> print "Create a new List on" in response.content True -Now create a new list called 'new_list'. -We should end up on a redirect +Creating a new List we do need to specify at least the below mentioned items. Those were entered using some nice GUI Forms which do only show up available Values or offer you to choose a name which will be checked during validation. +We're now submitting the form using a POST request and get redirected to the List Index Page + >>> response = c.post('/lists/new/', ... {"listname": "new_list1", ... "mail_host": "mail.example.com", @@ -197,11 +215,9 @@ >>> print type(response) == HttpResponseRedirect True -List index page should now include the realname of the list +As List index is an overview of all advertised Lists and we've choosen to do so we should now see our new List within the overview. HTTP_HOST is added as META Data for the request because we do only want to see Domains which belong to the example.com web_host >>> response = c.get('/lists/',HTTP_HOST='example.com') - -Then we check that everything went well. >>> response.status_code 200 >>> "New_list1" in response.content @@ -210,23 +226,18 @@ List Summary ============ -Four options appear on this page. The first one is to subscribe, -2. to view archives -3. to edit the list settings #at least if you do have permission to do so -4. to unsubscribe +List summary is a dashboard for each List. It does have Links to the most useful functions which are only related to that Domain. These include the Values mentioned below. _(function) is used to Translate these to you local language. >>> response = c.get('/lists/new_list1%40mail.example.com/',) - -Then we check that everything went well. >>> response.status_code 200 - >>> "Subscribe" in response.content + >>> _("Subscribe") in response.content True - >>> "Archives" in response.content + >>> _("Archives") in response.content True - >>> "Edit Options" in response.content + >>> _("Edit Options") in response.content True - >>> "Unsubscribe" in response.content + >>> _("Unsubscribe") in response.content True Subscriptions