|
5 | 5 | from django.conf import settings as django_conf_settings |
6 | 6 |
|
7 | 7 | from rest_framework import fields |
8 | | -from rest_framework.exceptions import ValidationError |
9 | 8 |
|
10 | 9 | from api.base import utils as api_utils |
11 | 10 | from osf.models.base import coerce_guid, Guid, GuidMixin, OptionalGuidMixin, VersionedGuidMixin, InvalidGuid |
@@ -63,49 +62,6 @@ def test_push_status_message_no_response(self): |
63 | 62 | except BaseException: |
64 | 63 | assert False, f'Exception from push_status_message via API v2 with type "{status}".' |
65 | 64 |
|
66 | | - @unittest.skip('[ANG-959] Make push_status_message NOOP (#11350)') |
67 | | - def test_push_status_message_expected_error(self): |
68 | | - status_message = 'This is a message' |
69 | | - try: |
70 | | - push_status_message(status_message, kind='error') |
71 | | - assert False, 'push_status_message() should have generated a ValidationError exception.' |
72 | | - |
73 | | - except ValidationError as e: |
74 | | - assert ( |
75 | | - e.detail[0] == status_message |
76 | | - ), 'push_status_message() should have passed along the message with the Exception.' |
77 | | - |
78 | | - except RuntimeError: |
79 | | - assert False, 'push_status_message() should have caught the runtime error and replaced it.' |
80 | | - |
81 | | - except BaseException: |
82 | | - assert False, 'Exception from push_status_message when called from the v2 API with type "error"' |
83 | | - |
84 | | - @unittest.skip('[ANG-959] Make push_status_message NOOP (#11350)') |
85 | | - @mock.patch('framework.status.get_session') |
86 | | - def test_push_status_message_unexpected_error(self, mock_get_session): |
87 | | - status_message = 'This is a message' |
88 | | - exception_message = 'this is some very unexpected problem' |
89 | | - mock_session = mock.Mock() |
90 | | - mock_session.attach_mock(mock.Mock(side_effect=RuntimeError(exception_message)), 'get') |
91 | | - mock_get_session.return_value = mock_session |
92 | | - try: |
93 | | - push_status_message(status_message, kind='error') |
94 | | - assert False, 'push_status_message() should have generated a RuntimeError exception.' |
95 | | - except ValidationError: |
96 | | - assert False, 'push_status_message() should have re-raised the RuntimeError not gotten ValidationError.' |
97 | | - except RuntimeError as e: |
98 | | - assert str(e) == exception_message, ( |
99 | | - 'push_status_message() should have re-raised the ' |
100 | | - 'original RuntimeError with the original message.' |
101 | | - ) |
102 | | - |
103 | | - except BaseException: |
104 | | - assert False, ( |
105 | | - 'Unexpected Exception from push_status_message when called ' |
106 | | - 'from the v2 API with type "error"' |
107 | | - ) |
108 | | - |
109 | 65 |
|
110 | 66 | @pytest.mark.django_db |
111 | 67 | class TestCoerceGuid: |
|
0 commit comments