comparison rhodecode/tests/functional/test_admin_gists.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 4b0d283ecede
children 7e5f8c12a3fc
comparison
equal deleted inserted replaced
4115:8b7294a804a0 4116:ffd45b185016
37 g2 = _create_gist('gist2', lifetime=1400).gist_access_id 37 g2 = _create_gist('gist2', lifetime=1400).gist_access_id
38 g3 = _create_gist('gist3', description='gist3-desc').gist_access_id 38 g3 = _create_gist('gist3', description='gist3-desc').gist_access_id
39 g4 = _create_gist('gist4', gist_type='private').gist_access_id 39 g4 = _create_gist('gist4', gist_type='private').gist_access_id
40 response = self.app.get(url('gists')) 40 response = self.app.get(url('gists'))
41 # Test response... 41 # Test response...
42 response.mustcontain('gist:%s' % g1) 42 response.mustcontain('gist: %s' % g1)
43 response.mustcontain('gist:%s' % g2) 43 response.mustcontain('gist: %s' % g2)
44 response.mustcontain('Expires: in 23 hours') # we don't care about the end 44 response.mustcontain('Expires: in 23 hours') # we don't care about the end
45 response.mustcontain('gist:%s' % g3) 45 response.mustcontain('gist: %s' % g3)
46 response.mustcontain('gist3-desc') 46 response.mustcontain('gist3-desc')
47 response.mustcontain(no=['gist:%s' % g4]) 47 response.mustcontain(no=['gist: %s' % g4])
48 48
49 def test_index_private_gists(self): 49 def test_index_private_gists(self):
50 self.log_user() 50 self.log_user()
51 gist = _create_gist('gist5', gist_type='private') 51 gist = _create_gist('gist5', gist_type='private')
52 response = self.app.get(url('gists', private=1)) 52 response = self.app.get(url('gists', private=1))
53 # Test response... 53 # Test response...
54 54
55 #and privates 55 #and privates
56 response.mustcontain('gist:%s' % gist.gist_access_id) 56 response.mustcontain('gist: %s' % gist.gist_access_id)
57 57
58 def test_create_missing_description(self): 58 def test_create_missing_description(self):
59 self.log_user() 59 self.log_user()
60 response = self.app.post(url('gists'), 60 response = self.app.post(url('gists'),
61 params={'lifetime': -1}, status=200) 61 params={'lifetime': -1}, status=200)
71 'public': 'public'}, 71 'public': 'public'},
72 status=302) 72 status=302)
73 response = response.follow() 73 response = response.follow()
74 response.mustcontain('added file: foo') 74 response.mustcontain('added file: foo')
75 response.mustcontain('gist test') 75 response.mustcontain('gist test')
76 response.mustcontain('<div class="ui-btn green badge">Public gist</div>') 76 response.mustcontain('<div class="btn btn-mini btn-success disabled">Public Gist</div>')
77 77
78 def test_create_with_path_with_dirs(self): 78 def test_create_with_path_with_dirs(self):
79 self.log_user() 79 self.log_user()
80 response = self.app.post(url('gists'), 80 response = self.app.post(url('gists'),
81 params={'lifetime': -1, 81 params={'lifetime': -1,
103 'private': 'private'}, 103 'private': 'private'},
104 status=302) 104 status=302)
105 response = response.follow() 105 response = response.follow()
106 response.mustcontain('added file: private-foo<') 106 response.mustcontain('added file: private-foo<')
107 response.mustcontain('private gist test') 107 response.mustcontain('private gist test')
108 response.mustcontain('<div class="ui-btn yellow badge">Private gist</div>') 108 response.mustcontain('<div class="btn btn-mini btn-warning disabled">Private Gist</div>')
109 109
110 def test_create_with_description(self): 110 def test_create_with_description(self):
111 self.log_user() 111 self.log_user()
112 response = self.app.post(url('gists'), 112 response = self.app.post(url('gists'),
113 params={'lifetime': -1, 113 params={'lifetime': -1,
118 status=302) 118 status=302)
119 response = response.follow() 119 response = response.follow()
120 response.mustcontain('added file: foo-desc') 120 response.mustcontain('added file: foo-desc')
121 response.mustcontain('gist test') 121 response.mustcontain('gist test')
122 response.mustcontain('gist-desc') 122 response.mustcontain('gist-desc')
123 response.mustcontain('<div class="ui-btn green badge">Public gist</div>') 123 response.mustcontain('<div class="btn btn-mini btn-success disabled">Public Gist</div>')
124 124
125 def test_new(self): 125 def test_new(self):
126 self.log_user() 126 self.log_user()
127 response = self.app.get(url('new_gist')) 127 response = self.app.get(url('new_gist'))
128 128
151 gist = _create_gist('gist-show-me') 151 gist = _create_gist('gist-show-me')
152 response = self.app.get(url('gist', gist_id=gist.gist_access_id)) 152 response = self.app.get(url('gist', gist_id=gist.gist_access_id))
153 response.mustcontain('added file: gist-show-me<') 153 response.mustcontain('added file: gist-show-me<')
154 response.mustcontain('test_admin (RhodeCode Admin) - created') 154 response.mustcontain('test_admin (RhodeCode Admin) - created')
155 response.mustcontain('gist-desc') 155 response.mustcontain('gist-desc')
156 response.mustcontain('<div class="ui-btn green badge">Public gist</div>') 156 response.mustcontain('<div class="btn btn-mini btn-success disabled">Public Gist</div>')
157 157
158 def test_show_as_raw(self): 158 def test_show_as_raw(self):
159 gist = _create_gist('gist-show-me', content='GIST CONTENT') 159 gist = _create_gist('gist-show-me', content='GIST CONTENT')
160 response = self.app.get(url('formatted_gist', 160 response = self.app.get(url('formatted_gist',
161 gist_id=gist.gist_access_id, format='raw')) 161 gist_id=gist.gist_access_id, format='raw'))
167 gist_id=gist.gist_access_id, format='raw', 167 gist_id=gist.gist_access_id, format='raw',
168 revision='tip', f_path='gist-show-me-raw')) 168 revision='tip', f_path='gist-show-me-raw'))
169 self.assertEqual(response.body, 'GIST BODY') 169 self.assertEqual(response.body, 'GIST BODY')
170 170
171 def test_edit(self): 171 def test_edit(self):
172 self.skipTest('not implemented')
173 response = self.app.get(url('edit_gist', gist_id=1)) 172 response = self.app.get(url('edit_gist', gist_id=1))