# HG changeset patch # User Marcin Kuzminski # Date 2017-11-16 13:19:52 # Node ID d77ebe762aae7cf3b5a6b1143f844599f240e773 # Parent 3ac4e253a98cdc755bf61e227822f34b2c962906 tests: improve assert_flash_message call when called with no_ and empty flash is present. diff --git a/rhodecode/tests/__init__.py b/rhodecode/tests/__init__.py --- a/rhodecode/tests/__init__.py +++ b/rhodecode/tests/__init__.py @@ -208,7 +208,11 @@ def assert_session_flash(response, msg=N messages = flash.pop_messages(session=session) msg = _eval_if_lazy(msg) - assert messages, 'unable to find message `%s` in empty flash list' % msg + if no_: + error_msg = 'unable to detect no_ message `%s` in empty flash list' % no_ + else: + error_msg = 'unable to find message `%s` in empty flash list' % msg + assert messages, error_msg message = messages[0] message_text = _eval_if_lazy(message.message) or ''