annotate rhodecode/tests/functional/test_admin_permissions.py @ 691:7486da5f0628 beta

Refactor codes for scm model Some test updates, added test for admin user controller
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 14 Nov 2010 22:54:16 +0100
parents rhodecode/tests/functional/test_permissions.py@1e757ac98988
children ffd45b185016
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
547
1e757ac98988 renamed project to rhodecode
Marcin Kuzminski <marcin@python-works.com>
parents: 230
diff changeset
1 from rhodecode.tests import *
230
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
2
691
7486da5f0628 Refactor codes for scm model
Marcin Kuzminski <marcin@python-works.com>
parents: 547
diff changeset
3 class TestAdminPermissionsController(TestController):
230
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
4
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
5 def test_index(self):
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
6 response = self.app.get(url('permissions'))
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
7 # Test response...
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
8
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
9 def test_index_as_xml(self):
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
10 response = self.app.get(url('formatted_permissions', format='xml'))
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
11
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
12 def test_create(self):
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
13 response = self.app.post(url('permissions'))
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
14
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
15 def test_new(self):
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
16 response = self.app.get(url('new_permission'))
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
17
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
18 def test_new_as_xml(self):
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
19 response = self.app.get(url('formatted_new_permission', format='xml'))
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
20
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
21 def test_update(self):
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
22 response = self.app.put(url('permission', id=1))
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
23
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
24 def test_update_browser_fakeout(self):
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
25 response = self.app.post(url('permission', id=1), params=dict(_method='put'))
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
26
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
27 def test_delete(self):
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
28 response = self.app.delete(url('permission', id=1))
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
29
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
30 def test_delete_browser_fakeout(self):
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
31 response = self.app.post(url('permission', id=1), params=dict(_method='delete'))
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
32
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
33 def test_show(self):
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
34 response = self.app.get(url('permission', id=1))
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
35
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
36 def test_show_as_xml(self):
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
37 response = self.app.get(url('formatted_permission', id=1, format='xml'))
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
38
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
39 def test_edit(self):
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
40 response = self.app.get(url('edit_permission', id=1))
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
41
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
42 def test_edit_as_xml(self):
d982ed8e32d8 Admin templating updates, added rest permission controllers
Marcin Kuzminski <marcin@python-works.com>
parents:
diff changeset
43 response = self.app.get(url('formatted_edit_permission', id=1, format='xml'))