Files
@ 15e507047bae
Branch filter:
Location: kallithea/rhodecode/tests/functional/test_admin_settings.py - annotation
15e507047bae
7.1 KiB
text/x-python
Incorporate CSS from select2-bootstrap-css & its license information.
RhodeCode 2.2.5 included a modified version of this upstream work. We
include herein the upstream version as downloaded and incorporated using the
following commands:
(cd /tmp; \
git clone https://github.com/t0m/select2-bootstrap-css
)
cp /tmp/select2-bootstrap-css/select2-bootstrap.css rhodecode/public/js/select2/
The content used to be appended to select2.css but we now keep it in a separate
file select2-bootstrap.css . This file could be included in root.html like
select2.css but we do currently not want to use bootstrap.
The license info was incorporated from /tmp/select2-bootstrap-css/LICENSE
into our LICENSE.md file.
RhodeCode 2.2.5 included a modified version of this upstream work. We
include herein the upstream version as downloaded and incorporated using the
following commands:
(cd /tmp; \
git clone https://github.com/t0m/select2-bootstrap-css
)
cp /tmp/select2-bootstrap-css/select2-bootstrap.css rhodecode/public/js/select2/
The content used to be appended to select2.css but we now keep it in a separate
file select2-bootstrap.css . This file could be included in root.html like
select2.css but we do currently not want to use bootstrap.
The license info was incorporated from /tmp/select2-bootstrap-css/LICENSE
into our LICENSE.md file.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | 9c0f5d558789 9c0f5d558789 101a407827e8 ffd45b185016 1e757ac98988 ffd45b185016 4419551b2915 6ce3387bf0ce d2901d906ef3 d7488551578e 4419551b2915 ffd45b185016 ffd45b185016 1e757ac98988 7486da5f0628 1e757ac98988 ffd45b185016 ffd45b185016 1e757ac98988 1e757ac98988 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 1e757ac98988 ffd45b185016 ffd45b185016 ffd45b185016 1e757ac98988 ffd45b185016 ffd45b185016 ffd45b185016 1e757ac98988 ffd45b185016 ffd45b185016 ffd45b185016 1e757ac98988 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 1e757ac98988 ffd45b185016 ffd45b185016 ffd45b185016 1e757ac98988 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 1e757ac98988 ffd45b185016 ffd45b185016 ffd45b185016 1e757ac98988 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 1e757ac98988 ffd45b185016 ffd45b185016 ffd45b185016 1e757ac98988 ffd45b185016 ffd45b185016 ffd45b185016 1e757ac98988 ead7be02283b ead7be02283b ead7be02283b ead7be02283b ead7be02283b ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ead7be02283b c310e1e1e757 c310e1e1e757 2c0d35e336b5 9c0f5d558789 ead7be02283b ead7be02283b 6ce3387bf0ce ead7be02283b ead7be02283b ead7be02283b ead7be02283b ead7be02283b ead7be02283b ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ead7be02283b 4f80df0d45c8 2c0d35e336b5 9c0f5d558789 ead7be02283b ead7be02283b 63e49418a4cc ead7be02283b ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ead7be02283b ead7be02283b ead7be02283b ead7be02283b ead7be02283b 9c0f5d558789 9c0f5d558789 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ffd45b185016 ead7be02283b c310e1e1e757 2c0d35e336b5 9c0f5d558789 9c0f5d558789 ead7be02283b 9c0f5d558789 ffd45b185016 | # -*- coding: utf-8 -*-
from rhodecode.lib.auth import get_crypt_password, check_password
from rhodecode.model.db import User, RhodeCodeSetting, Repository, RhodeCodeUi
from rhodecode.tests import *
from rhodecode.tests.fixture import Fixture
from rhodecode.lib import helpers as h
from rhodecode.model.user import UserModel
from rhodecode.model.scm import ScmModel
from rhodecode.model.meta import Session
fixture = Fixture()
class TestAdminSettingsController(TestController):
def test_index_main(self):
self.log_user()
response = self.app.get(url('admin_settings'))
def test_index_mapping(self):
self.log_user()
response = self.app.get(url('admin_settings_mapping'))
def test_index_global(self):
self.log_user()
response = self.app.get(url('admin_settings_global'))
def test_index_visual(self):
self.log_user()
response = self.app.get(url('admin_settings_visual'))
def test_index_email(self):
self.log_user()
response = self.app.get(url('admin_settings_email'))
def test_index_hooks(self):
self.log_user()
response = self.app.get(url('admin_settings_hooks'))
def test_create_custom_hook(self):
self.log_user()
response = self.app.post(url('admin_settings_hooks'),
params=dict(new_hook_ui_key='test_hooks_1',
new_hook_ui_value='cd /tmp'))
response = response.follow()
response.mustcontain('test_hooks_1')
response.mustcontain('cd /tmp')
def test_create_custom_hook_delete(self):
self.log_user()
response = self.app.post(url('admin_settings_hooks'),
params=dict(new_hook_ui_key='test_hooks_2',
new_hook_ui_value='cd /tmp2'))
response = response.follow()
response.mustcontain('test_hooks_2')
response.mustcontain('cd /tmp2')
hook_id = RhodeCodeUi.get_by_key('test_hooks_2').ui_id
## delete
self.app.post(url('admin_settings_hooks'),
params=dict(hook_id=hook_id))
response = self.app.get(url('admin_settings_hooks'))
response.mustcontain(no=['test_hooks_2'])
response.mustcontain(no=['cd /tmp2'])
def test_index_search(self):
self.log_user()
response = self.app.get(url('admin_settings_search'))
def test_index_system(self):
self.log_user()
response = self.app.get(url('admin_settings_system'))
def test_ga_code_active(self):
self.log_user()
old_title = 'RhodeCode'
old_realm = 'RhodeCode authentication'
new_ga_code = 'ga-test-123456789'
response = self.app.post(url('admin_settings_global'),
params=dict(rhodecode_title=old_title,
rhodecode_realm=old_realm,
rhodecode_ga_code=new_ga_code,
rhodecode_captcha_private_key='',
rhodecode_captcha_public_key='',
))
self.checkSessionFlash(response, 'Updated application settings')
self.assertEqual(RhodeCodeSetting
.get_app_settings()['rhodecode_ga_code'], new_ga_code)
response = response.follow()
response.mustcontain("""_gaq.push(['_setAccount', '%s']);""" % new_ga_code)
def test_ga_code_inactive(self):
self.log_user()
old_title = 'RhodeCode'
old_realm = 'RhodeCode authentication'
new_ga_code = ''
response = self.app.post(url('admin_settings_global'),
params=dict(rhodecode_title=old_title,
rhodecode_realm=old_realm,
rhodecode_ga_code=new_ga_code,
rhodecode_captcha_private_key='',
rhodecode_captcha_public_key='',
))
self.checkSessionFlash(response, 'Updated application settings')
self.assertEqual(RhodeCodeSetting
.get_app_settings()['rhodecode_ga_code'], new_ga_code)
response = response.follow()
response.mustcontain(no=["_gaq.push(['_setAccount', '%s']);" % new_ga_code])
def test_captcha_activate(self):
self.log_user()
old_title = 'RhodeCode'
old_realm = 'RhodeCode authentication'
new_ga_code = ''
response = self.app.post(url('admin_settings_global'),
params=dict(rhodecode_title=old_title,
rhodecode_realm=old_realm,
rhodecode_ga_code=new_ga_code,
rhodecode_captcha_private_key='1234567890',
rhodecode_captcha_public_key='1234567890',
))
self.checkSessionFlash(response, 'Updated application settings')
self.assertEqual(RhodeCodeSetting
.get_app_settings()['rhodecode_captcha_private_key'], '1234567890')
response = self.app.get(url('register'))
response.mustcontain('captcha')
def test_captcha_deactivate(self):
self.log_user()
old_title = 'RhodeCode'
old_realm = 'RhodeCode authentication'
new_ga_code = ''
response = self.app.post(url('admin_settings_global'),
params=dict(rhodecode_title=old_title,
rhodecode_realm=old_realm,
rhodecode_ga_code=new_ga_code,
rhodecode_captcha_private_key='',
rhodecode_captcha_public_key='1234567890',
))
self.checkSessionFlash(response, 'Updated application settings')
self.assertEqual(RhodeCodeSetting
.get_app_settings()['rhodecode_captcha_private_key'], '')
response = self.app.get(url('register'))
response.mustcontain(no=['captcha'])
def test_title_change(self):
self.log_user()
old_title = 'RhodeCode'
new_title = old_title + '_changed'
old_realm = 'RhodeCode authentication'
for new_title in ['Changed', 'Żółwik', old_title]:
response = self.app.post(url('admin_settings_global'),
params=dict(rhodecode_title=new_title,
rhodecode_realm=old_realm,
rhodecode_ga_code='',
rhodecode_captcha_private_key='',
rhodecode_captcha_public_key='',
))
self.checkSessionFlash(response, 'Updated application settings')
self.assertEqual(RhodeCodeSetting
.get_app_settings()['rhodecode_title'],
new_title.decode('utf-8'))
response = response.follow()
response.mustcontain("""<div class="branding">- %s</div>""" % new_title)
|