diff --git a/muranodashboard/tests/unit/dynamic_ui/test_fields.py b/muranodashboard/tests/unit/dynamic_ui/test_fields.py index e2b978834..84ef171a6 100644 --- a/muranodashboard/tests/unit/dynamic_ui/test_fields.py +++ b/muranodashboard/tests/unit/dynamic_ui/test_fields.py @@ -62,8 +62,8 @@ class TestFields(testtools.TestCase): @mock.patch.object(fields, 'LOG') def test_fields_except_validation_error(self, mock_log): - with self.assertRaisesRegexp(forms.ValidationError, - "Can't get a request information"): + with self.assertRaisesRegex(forms.ValidationError, + "Can't get a request information"): self._test_fields_decorator_with_validation_error({}, request=None) mock_log.error.assert_called_once_with( "No 'request' value passed neither via initial dictionary, nor " @@ -124,7 +124,7 @@ class TestFields(testtools.TestCase): def _validator(value): raise forms.ValidationError(None) - with self.assertRaisesRegexp(forms.ValidationError, 'foo'): + with self.assertRaisesRegex(forms.ValidationError, 'foo'): func = fields.wrap_regex_validator(_validator, 'foo') func(None) diff --git a/muranodashboard/tests/unit/dynamic_ui/test_forms.py b/muranodashboard/tests/unit/dynamic_ui/test_forms.py index 3001a28e2..d8f81ee07 100644 --- a/muranodashboard/tests/unit/dynamic_ui/test_forms.py +++ b/muranodashboard/tests/unit/dynamic_ui/test_forms.py @@ -194,8 +194,8 @@ class TestServiceConfigurationForm(testtools.TestCase): test_validator = {'expr': mock_expr, 'message': 'Foo Error'} self.form.validators = [test_validator] - with self.assertRaisesRegexp(django_forms.ValidationError, - 'Foo Error'): + with self.assertRaisesRegex(django_forms.ValidationError, + 'Foo Error'): self.form.clean() self.form.service.update_cleaned_data.assert_called_once_with( diff --git a/muranodashboard/tests/unit/dynamic_ui/test_services.py b/muranodashboard/tests/unit/dynamic_ui/test_services.py index 178f66dcf..4167cfdc7 100644 --- a/muranodashboard/tests/unit/dynamic_ui/test_services.py +++ b/muranodashboard/tests/unit/dynamic_ui/test_services.py @@ -100,8 +100,8 @@ class TestService(helpers.APITestCase): self.assertEqual(val, getattr(service.forms[0].service, key)) def test_init_service_except_value_error(self): - with self.assertRaisesRegexp(ValueError, - 'Application section is required'): + with self.assertRaisesRegex(ValueError, + 'Application section is required'): services.Service(cleaned_data={}, version=2, fqn='io.murano.Test', diff --git a/muranodashboard/tests/unit/environments/test_tables.py b/muranodashboard/tests/unit/environments/test_tables.py index 922cf7494..8c6b6eced 100644 --- a/muranodashboard/tests/unit/environments/test_tables.py +++ b/muranodashboard/tests/unit/environments/test_tables.py @@ -403,7 +403,7 @@ class TestUpdateEnvironmentRow(testtools.TestCase): data_table = tables.UpdateEnvironmentRow(self.mock_data_table) - with self.assertRaisesRegexp(django_http.Http404, None): + with self.assertRaisesRegex(django_http.Http404, None): data_table.get_data(None, 'foo_environment_id') @mock.patch.object(tables, 'api') @@ -412,7 +412,7 @@ class TestUpdateEnvironmentRow(testtools.TestCase): data_table = tables.UpdateEnvironmentRow(self.mock_data_table) - with self.assertRaisesRegexp(Exception, 'foo_error'): + with self.assertRaisesRegex(Exception, 'foo_error'): data_table.get_data(None, 'foo_environment_id') diff --git a/muranodashboard/tests/unit/packages/test_forms.py b/muranodashboard/tests/unit/packages/test_forms.py index db60b3035..fb8344191 100644 --- a/muranodashboard/tests/unit/packages/test_forms.py +++ b/muranodashboard/tests/unit/packages/test_forms.py @@ -39,8 +39,8 @@ class TestImportBundleForm(helpers.APITestCase): 'import_type': 'by_{0}'.format(attr), attr: None} expected_error_msg = 'Please supply a bundle {0}'.format(attr) - with self.assertRaisesRegexp(django_forms.ValidationError, - expected_error_msg): + with self.assertRaisesRegex(django_forms.ValidationError, + expected_error_msg): import_bundle_form.clean() @@ -74,8 +74,8 @@ class TestImportPackageForm(helpers.APITestCase): expected_error_msg = 'It is forbidden to upload files larger than {0} '\ 'MB.'.format(consts.MAX_FILE_SIZE_MB) - with self.assertRaisesRegexp(django_forms.ValidationError, - expected_error_msg): + with self.assertRaisesRegex(django_forms.ValidationError, + expected_error_msg): self.import_pkg_form.clean_package() def test_clean_form(self): @@ -100,8 +100,8 @@ class TestImportPackageForm(helpers.APITestCase): expected_error_msg = 'Please supply a package {0}'.\ format(_tuple[2]) - with self.assertRaisesRegexp(django_forms.ValidationError, - expected_error_msg): + with self.assertRaisesRegex(django_forms.ValidationError, + expected_error_msg): self.import_pkg_form.clean() diff --git a/muranodashboard/tests/unit/packages/test_views.py b/muranodashboard/tests/unit/packages/test_views.py index cc2d6e3ef..4eb241c2a 100644 --- a/muranodashboard/tests/unit/packages/test_views.py +++ b/muranodashboard/tests/unit/packages/test_views.py @@ -485,7 +485,7 @@ class TestImportPackageWizard(helpers.APITestCase): mock_json.loads.side_effect = ValueError('test_error_message') original_e = ValueError('original_error_message') setattr(original_e, 'details', 'error_details') - with self.assertRaisesRegexp(ValueError, 'original_error_message'): + with self.assertRaisesRegex(ValueError, 'original_error_message'): self.import_pkg_wizard._handle_exception(original_e) @mock.patch.object(views, 'glance') @@ -564,8 +564,8 @@ class TestImportPackageWizard(helpers.APITestCase): exception.message = error_message mock_murano_utils.Package.from_file.side_effect = exception - with self.assertRaisesRegexp(horizon_exceptions.Http302, - None): + with self.assertRaisesRegex(horizon_exceptions.Http302, + None): self.import_pkg_wizard.process_step(mock_form) mock_log.exception.assert_called_once_with(expected_error_message) @@ -915,7 +915,7 @@ class TestImportBundleWizard(helpers.APITestCase): for exception, expected_error_message in errors: mock_murano_utils.Bundle.from_file.side_effect = exception - with self.assertRaisesRegexp(horizon_exceptions.Http302, None): + with self.assertRaisesRegex(horizon_exceptions.Http302, None): self.import_bundle_wizard.process_step(mock_form) mock_log.exception.assert_called_once_with(expected_error_message)