diff --git a/awx/main/tests/functional/models/test_schedule.py b/awx/main/tests/functional/models/test_schedule.py index aee73e50eb..525fdd3022 100644 --- a/awx/main/tests/functional/models/test_schedule.py +++ b/awx/main/tests/functional/models/test_schedule.py @@ -457,4 +457,4 @@ def test_duplicate_name_within_template(job_template): with pytest.raises(IntegrityError) as ierror: s2.save() - assert str(ierror.value) == "columns unified_job_template_id, name are not unique" + assert str(ierror.value) == "UNIQUE constraint failed: main_schedule.unified_job_template_id, main_schedule.name" diff --git a/awx/main/tests/unit/api/test_generics.py b/awx/main/tests/unit/api/test_generics.py index de7f8ab4c8..caac45bc3b 100644 --- a/awx/main/tests/unit/api/test_generics.py +++ b/awx/main/tests/unit/api/test_generics.py @@ -186,11 +186,8 @@ class TestResourceAccessList: def mock_request(self): return mock.MagicMock( - user=mock.MagicMock( - is_anonymous=mock.MagicMock(return_value=False), - is_superuser=False - ), method='GET') - + user=mock.MagicMock(is_anonymous=False, is_superuser=False), + method='GET') def mock_view(self, parent=None): view = ResourceAccessList() @@ -200,7 +197,6 @@ class TestResourceAccessList: view.get_parent_object = lambda: parent return view - def test_parent_access_check_failed(self, mocker, mock_organization): mock_access = mocker.MagicMock(__name__='for logger', return_value=False) with mocker.patch('awx.main.access.BaseAccess.can_read', mock_access): @@ -208,7 +204,6 @@ class TestResourceAccessList: self.mock_view(parent=mock_organization).check_permissions(self.mock_request()) mock_access.assert_called_once_with(mock_organization) - def test_parent_access_check_worked(self, mocker, mock_organization): mock_access = mocker.MagicMock(__name__='for logger', return_value=True) with mocker.patch('awx.main.access.BaseAccess.can_read', mock_access):