Comment 0 for bug 244371

Revision history for this message
Matthew Paul Thomas (mpt) wrote :

In pagetests, get_feedback_messages() returns a Python list of feedback messages from the given browser. Of the ~290 places in our pagetests where get_feedback_messages() is used, almost all of them print out this list one member per line:

    >>> for message in get_feedback_messages(user_browser.contents):
    ... print message

or the equivalent

    >>> messages = get_feedback_messages(jblack_browser.contents)
    >>> for msg in messages:
    ... print msg

or the slightly more acrobatic

    >>> print "\n".join(get_feedback_messages(user_browser.contents))

Very occasionally a test does something different, but not usefully so:

    >>> get_feedback_messages(browser.contents)
    [u'Your choice has been saved. Your translations will be removed
    once we completely switch to BSD license for translations.']

The only test I can see that actually does something different with the list is bug-also-affects/xx-also-affects-new-upstream.txt:

    >>> print get_feedback_messages(user_browser.contents)[-1]

To make tests easier to write and reduce redundancy, I suggest replacing get_feedback_messages() with a print_feedback_messages() function that will do what the pagetests want.