##// END OF EJS Templates
tests: fixed simplevcs tests
super-admin -
r5167:039ef6ec default
parent child Browse files
Show More
@@ -118,18 +118,20 b' def test_user_factory(request, baseapp):'
118 setattr(usr, k, v)
118 setattr(usr, k, v)
119 Session().add(usr)
119 Session().add(usr)
120
120
121 assert User.get_by_username(username) == usr
121 new_usr = User.get_by_username(username)
122 new_usr_id = new_usr.user_id
123 assert new_usr == usr
122
124
123 @request.addfinalizer
125 @request.addfinalizer
124 def cleanup():
126 def cleanup():
125 if UserModel().get_user(usr.user_id) is None:
127 if User.get(new_usr_id) is None:
126 return
128 return
127
129
128 perm = Permission.query().all()
130 perm = Permission.query().all()
129 for p in perm:
131 for p in perm:
130 UserModel().revoke_perm(usr, p)
132 UserModel().revoke_perm(usr, p)
131
133
132 UserModel().delete(usr.user_id)
134 UserModel().delete(new_usr_id)
133 Session().commit()
135 Session().commit()
134 return usr
136 return usr
135
137
@@ -144,11 +144,6 b' def test_handles_exceptions_during_permi'
144 assert get_user.called
144 assert get_user.called
145
145
146
146
147 def test_returns_forbidden_if_no_anonymous_access(
148 vcscontroller, disable_anonymous_user):
149 vcscontroller.get('/', status=401)
150
151
152 class StubFailVCSController(simplevcs.SimpleVCS):
147 class StubFailVCSController(simplevcs.SimpleVCS):
153 def _handle_request(self, environ, start_response):
148 def _handle_request(self, environ, start_response):
154 raise Exception("BOOM")
149 raise Exception("BOOM")
General Comments 0
You need to be logged in to leave comments. Login now