##// END OF EJS Templates
tests: Fix tests for moved labs setting....
Martin Bornhold -
r371:47b7ed9f default
parent child Browse files
Show More
@@ -343,6 +343,38 b' class TestAdminSettingsVcs:'
343 343 setting = SettingsModel().get_setting_by_name(setting_key)
344 344 assert setting.app_settings_value is new_value
345 345
346 def test_has_a_section_for_labs_settings_if_enabled(self, app):
347 with mock.patch.dict(
348 rhodecode.CONFIG, {'labs_settings_active': 'true'}):
349 response = self.app.get(url('admin_settings_vcs'))
350 response.mustcontain('Labs settings:')
351
352 def test_has_not_a_section_for_labs_settings_if_disables(self, app):
353 with mock.patch.dict(
354 rhodecode.CONFIG, {'labs_settings_active': 'false'}):
355 response = self.app.get(url('admin_settings_vcs'))
356 response.mustcontain(no='Labs settings:')
357
358 @pytest.mark.parametrize('new_value', [True, False])
359 def test_allows_to_change_hg_rebase_merge_strategy(
360 self, app, form_defaults, csrf_token, new_value):
361 setting_key = 'hg_use_rebase_for_merging'
362
363 form_defaults.update({
364 'csrf_token': csrf_token,
365 'rhodecode_' + setting_key: str(new_value),
366 })
367
368 with mock.patch.dict(
369 rhodecode.CONFIG, {'labs_settings_active': 'true'}):
370 app.post(
371 url('admin_settings_vcs'),
372 params=form_defaults,
373 status=302)
374
375 setting = SettingsModel().get_setting_by_name(setting_key)
376 assert setting.app_settings_value is new_value
377
346 378 @pytest.fixture
347 379 def disable_sql_cache(self, request):
348 380 patcher = mock.patch(
@@ -414,7 +446,6 b' class TestLabsSettings(object):'
414 446
415 447 @pytest.mark.parametrize('setting_name', [
416 448 'proxy_subversion_http_requests',
417 'hg_use_rebase_for_merging',
418 449 ])
419 450 def test_update_boolean_settings(self, csrf_token, setting_name):
420 451 self.app.post(
General Comments 0
You need to be logged in to leave comments. Login now