# HG changeset patch # User Marcin Kuzminski # Date 2016-11-07 14:44:47 # Node ID 07c2ecba225db07d512355d3a081a23bebcd2a3c # Parent aaf802d55004a98ea6e3639b3e039ffc20eb75db tests: improve detection of empty flash messages during the tests diff --git a/rhodecode/tests/__init__.py b/rhodecode/tests/__init__.py --- a/rhodecode/tests/__init__.py +++ b/rhodecode/tests/__init__.py @@ -224,9 +224,11 @@ def assert_session_flash(response=None, raise ValueError("Parameter msg is required.") messages = flash.pop_messages() + msg = _eval_if_lazy(msg) + + assert messages, 'unable to find message `%s` in empty flash list' % msg message = messages[0] - msg = _eval_if_lazy(msg) message_text = _eval_if_lazy(message.message) if msg not in message_text: