diff --git a/tests/test_pagure_flask_ui_app.py b/tests/test_pagure_flask_ui_app.py index 4ed0f56..f64e3b0 100644 --- a/tests/test_pagure_flask_ui_app.py +++ b/tests/test_pagure_flask_ui_app.py @@ -638,9 +638,15 @@ class PagureFlaskApptests(tests.Modeltests): output_text = output.get_data(as_text=True) self.assertIn( 'foo\'s settings - Pagure', output_text) - self.assertIn( - '', output_text) + if self.get_wtforms_version() >= (2, 2): + self.assertIn( + '', + output_text) + else: + self.assertIn( + '', output_text) csrf_token = self.get_csrf(output=output) @@ -684,9 +690,15 @@ class PagureFlaskApptests(tests.Modeltests): self.assertIn('Public ssh key updated', output_text) self.assertIn( 'foo\'s settings - Pagure', output_text) - self.assertIn( - '', output_text) + '', output_text) + '', output_text) + if self.get_wtforms_version() >= (2, 2): + self.assertIn( + '', + output_text) + else: + self.assertIn( + '', output_text) csrf_token = self.get_csrf(output=output) @@ -1179,9 +1197,15 @@ class PagureFlaskApptests(tests.Modeltests): output_text = output.get_data(as_text=True) self.assertIn( 'pingou\'s settings - Pagure', output_text) - self.assertIn( - '', output_text) + if self.get_wtforms_version() >= (2, 2): + self.assertIn( + '', + output_text) + else: + self.assertIn( + '', output_text) csrf_token = self.get_csrf(output=output) @@ -1270,9 +1294,15 @@ class PagureFlaskApptests(tests.Modeltests): output_text = output.get_data(as_text=True) self.assertIn( 'pingou\'s settings - Pagure', output_text) - self.assertIn( - '', output_text) + if self.get_wtforms_version() >= (2, 2): + self.assertIn( + '', + output_text) + else: + self.assertIn( + '', output_text) csrf_token = self.get_csrf(output=output) diff --git a/tests/test_pagure_flask_ui_plugins_noff.py b/tests/test_pagure_flask_ui_plugins_noff.py index 813b438..bb301fc 100644 --- a/tests/test_pagure_flask_ui_plugins_noff.py +++ b/tests/test_pagure_flask_ui_plugins_noff.py @@ -42,9 +42,14 @@ class PagureFlaskPluginNoFFtests(tests.SimplePagureTest): self.assertIn( 'Settings Block non fast-forward pushes - test - ' 'Pagure', output_text) - self.assertIn( - '', output_text) + if self.get_wtforms_version() >= (2, 2): + self.assertIn( + '', output_text) + else: + self.assertIn( + '', output_text) self.assertTrue( '' in output_text) @@ -61,9 +66,14 @@ class PagureFlaskPluginNoFFtests(tests.SimplePagureTest): self.assertIn( 'Settings Block non fast-forward pushes - test - ' 'Pagure', output_text) - self.assertIn( - '', output_text) + if self.get_wtforms_version() >= (2, 2): + self.assertIn( + '', output_text) + else: + self.assertIn( + '', output_text) self.assertTrue( '' in output_text) @@ -90,9 +100,14 @@ class PagureFlaskPluginNoFFtests(tests.SimplePagureTest): self.assertIn( 'Settings Block non fast-forward pushes - test - ' 'Pagure', output_text) - self.assertIn( - '', output_text) + if self.get_wtforms_version() >= (2, 2): + self.assertIn( + '', output_text) + else: + self.assertIn( + '', output_text) self.assertTrue( '' in output_text) @@ -155,9 +170,14 @@ class PagureFlaskPluginNoFFtests(tests.SimplePagureTest): self.assertIn( 'Settings Block non fast-forward pushes - test - ' 'Pagure', output_text) - self.assertIn( - '', output_text) + if self.get_wtforms_version() >= (2, 2): + self.assertIn( + '', output_text) + else: + self.assertIn( + '', output_text) self.assertIn( '', output_text) @@ -186,9 +206,14 @@ class PagureFlaskPluginNoFFtests(tests.SimplePagureTest): self.assertIn( 'Settings Block non fast-forward pushes - test - ' 'Pagure', output_text) - self.assertIn( - '', output_text) + if self.get_wtforms_version() >= (2, 2): + self.assertIn( + '', output_text) + else: + self.assertIn( + '', output_text) self.assertIn( '', output_text) diff --git a/tests/test_pagure_flask_ui_repo.py b/tests/test_pagure_flask_ui_repo.py index b45356f..ab6faa0 100644 --- a/tests/test_pagure_flask_ui_repo.py +++ b/tests/test_pagure_flask_ui_repo.py @@ -4494,9 +4494,14 @@ index 0000000..fb7093d self.assertIn( 'Settings - test - Pagure', output_text) self.assertIn('
Project Settings
', output_text) - self.assertIn( - '', output_text) + if self.get_wtforms_version() >= (2, 2): + self.assertIn( + '', output_text) + else: + self.assertIn( + '', output_text) csrf_token = output_text.split( 'name="csrf_token" type="hidden" value="')[1].split('">')[0] @@ -4523,7 +4528,8 @@ index 0000000..fb7093d 'csrf_token': csrf_token, } - output = self.app.post('/test/default/branch/', # changing head to feature branch + # changing head to feature branch + output = self.app.post('/test/default/branch/', data=data, follow_redirects=True) self.assertEqual(output.status_code, 200) @@ -4531,11 +4537,19 @@ index 0000000..fb7093d self.assertIn( 'Settings - test - Pagure', output_text) self.assertIn('
Project Settings
', output_text) - self.assertIn( - '', output_text) + if self.get_wtforms_version() >= (2, 2): + self.assertIn( + '', output_text) + else: + self.assertIn( + '', output_text) self.assertIn( '\n Default branch updated ' 'to feature', output_text) @@ -4545,7 +4559,8 @@ index 0000000..fb7093d 'csrf_token': csrf_token, } - output = self.app.post('/test/default/branch/', # changing head to master branch + # changing head to master branch + output = self.app.post('/test/default/branch/', data=data, follow_redirects=True) self.assertEqual(output.status_code, 200) @@ -4553,11 +4568,19 @@ index 0000000..fb7093d self.assertIn( 'Settings - test - Pagure', output_text) self.assertIn('
Project Settings
', output_text) - self.assertIn( - '', output_text) + if self.get_wtforms_version() >= (2, 2): + self.assertIn( + '', output_text) + else: + self.assertIn( + '', output_text) self.assertIn( '\n Default branch updated ' 'to master', output_text)