

def test_push_status_message_expected_error(self):
    status_message = 'This is a message'
    try:
        push_status_message(status_message, kind='error')
        assert_true(False, 'push_status_message() should have generated a ValidationError exception.')
    except ValidationError as e:
        assert_equal(e.detail[0], self, 'push_status_message() should have passed along the message with the Exception.')
    except RuntimeError:
        assert_true(False, 'push_status_message() should have caught the runtime error and replaced it.')
    except:
        assert_true(False, 'Exception from push_status_message when called from the v2 API with type "error"')

dataset/ETHPy150Open CenterForOpenScience/osf.io/api_tests/base/test_utils.py FlaskDjangoIntegrationTestCase.test_push_status_message_expected_error/VarMisuse@51/96 `status_message`->`self`