Changeset - 61f8ce5fff25
[Not reviewed]
default
0 1 0
Thomas De Schampheleire - 7 years ago 2018-05-20 21:50:11
thomas.de_schampheleire@nokia.com
admin: hooks: check session flashes in tests

Add checking of the session flash when a new hook is added.
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
kallithea/tests/functional/test_admin_settings.py
Show inline comments
 
@@ -37,23 +37,25 @@ class TestAdminSettingsController(TestCo
 
        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 %s' % TESTS_TMP_PATH,
 
                                            _authentication_token=self.authentication_token()))
 

	
 
        self.checkSessionFlash(response, 'Added new hook')
 
        response = response.follow()
 
        response.mustcontain('test_hooks_1')
 
        response.mustcontain('cd %s' % TESTS_TMP_PATH)
 

	
 
    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 %s2' % TESTS_TMP_PATH,
 
                                            _authentication_token=self.authentication_token()))
 

	
 
        self.checkSessionFlash(response, 'Added new hook')
 
        response = response.follow()
 
        response.mustcontain('test_hooks_2')
 
        response.mustcontain('cd %s2' % TESTS_TMP_PATH)
 

	
 
        hook_id = Ui.get_by_key('hooks', 'test_hooks_2').ui_id
 
        ## delete
0 comments (0 inline, 0 general)