get_feedback_messages() callsites have highly repetitive code

Bug #244371 reported by Matthew Paul Thomas
2
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Low
Steve Kowalik

Bug Description

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 print the feedback messages one per line.

Related branches

description: updated
Curtis Hovey (sinzui)
visibility: private → public
Changed in launchpad-foundations:
importance: Undecided → Low
status: New → Triaged
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :

Fixed in stable r16780 (http://bazaar.launchpad.net/~launchpad-pqm/launchpad/stable/revision/16780) by a commit, but not testable.

Changed in launchpad:
assignee: nobody → Steve Kowalik (stevenk)
tags: added: qa-untestable
Changed in launchpad:
status: Triaged → Fix Committed
Colin Watson (cjwatson)
Changed in launchpad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.