comparison rhodecode/tests/functional/test_admin_permissions.py @ 4116:ffd45b185016 rhodecode-2.2.5-gpl

Imported some of the GPLv3'd changes from RhodeCode v2.2.5. This imports changes between changesets 21af6c4eab3d and 6177597791c2 in RhodeCode's original repository, including only changes to Python files and HTML. RhodeCode clearly licensed its changes to these files under GPLv3 in their /LICENSE file, which states the following: The Python code and integrated HTML are licensed under the GPLv3 license. (See: https://code.rhodecode.com/rhodecode/files/v2.2.5/LICENSE or http://web.archive.org/web/20140512193334/https://code.rhodecode.com/rhodecode/files/f3b123159901f15426d18e3dc395e8369f70ebe0/LICENSE for an online copy of that LICENSE file) Conservancy reviewed these changes and confirmed that they can be licensed as a whole to the Kallithea project under GPLv3-only. While some of the contents committed herein are clearly licensed GPLv3-or-later, on the whole we must assume the are GPLv3-only, since the statement above from RhodeCode indicates that they intend GPLv3-only as their license, per GPLv3ยง14 and other relevant sections of GPLv3.
author Bradley M. Kuhn <bkuhn@sfconservancy.org>
date Wed, 02 Jul 2014 19:03:13 -0400
parents 7486da5f0628
children 7e5f8c12a3fc
comparison
equal deleted inserted replaced
4115:8b7294a804a0 4116:ffd45b185016
1 from rhodecode.model.db import User, UserIpMap
1 from rhodecode.tests import * 2 from rhodecode.tests import *
2 3
3 class TestAdminPermissionsController(TestController): 4 class TestAdminPermissionsController(TestController):
4 5
5 def test_index(self): 6 def test_index(self):
6 response = self.app.get(url('permissions')) 7 self.log_user()
8 response = self.app.get(url('admin_permissions'))
7 # Test response... 9 # Test response...
8 10
9 def test_index_as_xml(self): 11 def test_index_ips(self):
10 response = self.app.get(url('formatted_permissions', format='xml')) 12 self.log_user()
13 response = self.app.get(url('admin_permissions_ips'))
14 # Test response...
15 response.mustcontain('All IP addresses are allowed')
11 16
12 def test_create(self): 17 def test_add_ips(self):
13 response = self.app.post(url('permissions')) 18 self.log_user()
19 default_user_id = User.get_default_user().user_id
20 response = self.app.put(url('edit_user_ips', id=default_user_id),
21 params=dict(new_ip='127.0.0.0/24'))
14 22
15 def test_new(self): 23 response = self.app.get(url('admin_permissions_ips'))
16 response = self.app.get(url('new_permission')) 24 response.mustcontain('127.0.0.0/24')
25 response.mustcontain('127.0.0.0 - 127.0.0.255')
17 26
18 def test_new_as_xml(self): 27 ## delete
19 response = self.app.get(url('formatted_new_permission', format='xml')) 28 default_user_id = User.get_default_user().user_id
29 del_ip_id = UserIpMap.query().filter(UserIpMap.user_id ==
30 default_user_id).first().ip_id
20 31
21 def test_update(self): 32 response = self.app.post(url('edit_user_ips', id=default_user_id),
22 response = self.app.put(url('permission', id=1)) 33 params=dict(_method='delete',
34 del_ip_id=del_ip_id))
23 35
24 def test_update_browser_fakeout(self): 36 response = self.app.get(url('admin_permissions_ips'))
25 response = self.app.post(url('permission', id=1), params=dict(_method='put')) 37 response.mustcontain('All IP addresses are allowed')
38 response.mustcontain(no=['127.0.0.0/24'])
39 response.mustcontain(no=['127.0.0.0 - 127.0.0.255'])
26 40
27 def test_delete(self):
28 response = self.app.delete(url('permission', id=1))
29 41
30 def test_delete_browser_fakeout(self): 42 def test_index_overview(self):
31 response = self.app.post(url('permission', id=1), params=dict(_method='delete')) 43 self.log_user()
32 44 response = self.app.get(url('admin_permissions_perms'))
33 def test_show(self): 45 # Test response...
34 response = self.app.get(url('permission', id=1))
35
36 def test_show_as_xml(self):
37 response = self.app.get(url('formatted_permission', id=1, format='xml'))
38
39 def test_edit(self):
40 response = self.app.get(url('edit_permission', id=1))
41
42 def test_edit_as_xml(self):
43 response = self.app.get(url('formatted_edit_permission', id=1, format='xml'))