##// END OF EJS Templates
old style: make compare header expand to content
old style: make compare header expand to content

File last commit:

r4116:ffd45b18 rhodecode-2.2.5-gpl
r4152:8d1125a4 rhodecode-2.2.5-gpl
Show More
test_admin_settings.py
179 lines | 7.1 KiB | text/x-python | PythonLexer
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached...
r1366 # -*- coding: utf-8 -*-
fixed test that broke admin email address
r754 from rhodecode.lib.auth import get_crypt_password, check_password
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 from rhodecode.model.db import User, RhodeCodeSetting, Repository, RhodeCodeUi
renamed project to rhodecode
r547 from rhodecode.tests import *
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 from rhodecode.tests.fixture import Fixture
Switched forms to new validators
r2467 from rhodecode.lib import helpers as h
Renamed name to firstname in forms...
r2544 from rhodecode.model.user import UserModel
Fixed issue #501 error on setting set_as_fork to same repo...
r2629 from rhodecode.model.scm import ScmModel
synced vcs with upstream...
r3797 from rhodecode.model.meta import Session
Switched forms to new validators
r2467
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 fixture = Fixture()
renamed project to rhodecode
r547
Refactor codes for scm model...
r691 class TestAdminSettingsController(TestController):
renamed project to rhodecode
r547
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 def test_index_main(self):
self.log_user()
renamed project to rhodecode
r547 response = self.app.get(url('admin_settings'))
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 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'))
renamed project to rhodecode
r547
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 def test_index_visual(self):
self.log_user()
response = self.app.get(url('admin_settings_visual'))
renamed project to rhodecode
r547
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 def test_index_email(self):
self.log_user()
response = self.app.get(url('admin_settings_email'))
renamed project to rhodecode
r547
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 def test_index_hooks(self):
self.log_user()
response = self.app.get(url('admin_settings_hooks'))
renamed project to rhodecode
r547
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 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'))
renamed project to rhodecode
r547
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 response = response.follow()
response.mustcontain('test_hooks_1')
response.mustcontain('cd /tmp')
renamed project to rhodecode
r547
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 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'))
renamed project to rhodecode
r547
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 response = response.follow()
response.mustcontain('test_hooks_2')
response.mustcontain('cd /tmp2')
renamed project to rhodecode
r547
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 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'])
renamed project to rhodecode
r547
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 def test_index_search(self):
self.log_user()
response = self.app.get(url('admin_settings_search'))
renamed project to rhodecode
r547
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 def test_index_system(self):
self.log_user()
response = self.app.get(url('admin_settings_system'))
renamed project to rhodecode
r547
updated tests for application settings
r893 def test_ga_code_active(self):
self.log_user()
old_title = 'RhodeCode'
old_realm = 'RhodeCode authentication'
new_ga_code = 'ga-test-123456789'
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 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='',
))
updated tests for application settings
r893
Added CheckSessionFlash into init....
r1382 self.checkSessionFlash(response, 'Updated application settings')
refactoring of models names for repoGroup permissions
r1633 self.assertEqual(RhodeCodeSetting
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached...
r1366 .get_app_settings()['rhodecode_ga_code'], new_ga_code)
updated tests for application settings
r893
response = response.follow()
Renamed name to firstname in forms...
r2544 response.mustcontain("""_gaq.push(['_setAccount', '%s']);""" % new_ga_code)
updated tests for application settings
r893
def test_ga_code_inactive(self):
self.log_user()
old_title = 'RhodeCode'
old_realm = 'RhodeCode authentication'
new_ga_code = ''
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 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='',
))
updated tests for application settings
r893
unified flash msg tests
r3640 self.checkSessionFlash(response, 'Updated application settings')
refactoring of models names for repoGroup permissions
r1633 self.assertEqual(RhodeCodeSetting
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached...
r1366 .get_app_settings()['rhodecode_ga_code'], new_ga_code)
updated tests for application settings
r893
response = response.follow()
Use only mustcontain for testing response body
r3646 response.mustcontain(no=["_gaq.push(['_setAccount', '%s']);" % new_ga_code])
updated tests for application settings
r893
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 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'])
updated tests for application settings
r893 def test_title_change(self):
self.log_user()
old_title = 'RhodeCode'
new_title = old_title + '_changed'
old_realm = 'RhodeCode authentication'
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached...
r1366
for new_title in ['Changed', 'Żółwik', old_title]:
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 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='',
))
updated tests for application settings
r893
Added CheckSessionFlash into init....
r1382 self.checkSessionFlash(response, 'Updated application settings')
refactoring of models names for repoGroup permissions
r1633 self.assertEqual(RhodeCodeSetting
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached...
r1366 .get_app_settings()['rhodecode_title'],
new_title.decode('utf-8'))
updated tests for application settings
r893
fixes #200, rewrote the whole caching mechanism to get rid of such problems. Now cached instances are attached...
r1366 response = response.follow()
Bradley M. Kuhn
Imported some of the GPLv3'd changes from RhodeCode v2.2.5....
r4116 response.mustcontain("""<div class="branding">- %s</div>""" % new_title)