Show
Ignore:
Timestamp:
2009年08月23日 17时21分57秒 (3 years ago)
Author:
jiangx
Message:

nosetest passed.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/0.2.3.x/pysvnmanager/tests/functional/test_repos.py

    r55 r100  
    2626        res = self.app.get(url_for(controller='repos')) 
    2727        assert res.status == 302 
    28         self.assertEqual(res.header('location'), 'http://localhost/login') 
     28        self.assertEqual(res.header('location'), '/login') 
    2929 
    3030        # Login as common user 
     
    3232        res = self.app.get(url_for(controller='repos')) 
    3333        assert res.status == 302, res.status 
    34         assert res.header('location')=='http://localhost/security/failed', res.header('location') 
     34        assert res.header('location')=='/security/failed', res.header('location') 
    3535         
    36         # Permission denied for repos admin(not root admin) 
     36        # repos admin can access repos controller(not root admin), but only with authed repos 
    3737        self.login('admin2') 
    3838        res = self.app.get(url_for(controller='repos')) 
    39         assert res.status == 302, res.status 
    40         assert res.header('location')=='http://localhost/security/failed', res.header('location') 
     39        assert res.status == 200, res.status 
     40 
     41        # ??? Repos admin can or can not manage hooks for his/her repos ??? 
     42        self.login('admin2') 
     43        res = self.app.get(url_for(controller='repos', action='init_repos_list')) 
     44        assert """id[0]="...";name[0]="Please choose..."; 
     45total=1;""" in res.body, res.body 
    4146 
    4247        # Login as superuser 
     
    5257        assert res.status == 200 
    5358        assert """id[0]="...";name[0]="Please choose..."; 
    54 id[1]="project1";name[1]="project1"; 
    55 id[2]="project2";name[2]="project2"; 
    56 id[3]="repos3";name[3]="repos3"; 
    57 total=4; 
    58 """ in res.body, res.body[:100] 
     59id[1]="repos3";name[1]="repos3"; 
     60id[2]="project1";name[2]="project1 (!)"; 
     61id[3]="project2";name[3]="project2 (!)"; 
     62total=4;""" in res.body, res.body[:200] 
    5963     
    6064    def test_get_plugin_list(self):