launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #05603
[Merge] lp:~allenap/launchpad/diff-row-testfix into lp:launchpad
Gavin Panella has proposed merging lp:~allenap/launchpad/diff-row-testfix into lp:launchpad.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~allenap/launchpad/diff-row-testfix/+merge/82695
Fix buildbot test failure:
Traceback (most recent call last):
File ".../lib/lp/registry/browser/tests/test_distroseries.py", line 2601, in test_diff_row_last_changed_also_shows_uploader_if_different
normalize_whitespace(creator_cell.text_content()))
AssertionError: !=:
reference = u'a moment ago by Person-name-205422 (uploaded by Person-name-205427)'
actual = '14 seconds ago by Person-name-205422 (uploaded by Person-name-205427)'
See [1] for the full log.
I've also fixed a couple of other places in the file where "a moment"
was being matched.
[1] https://lpbuildbot.canonical.com/builders/lucid_lp/builds/1566/steps/shell_6/logs/summary
--
https://code.launchpad.net/~allenap/launchpad/diff-row-testfix/+merge/82695
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~allenap/launchpad/diff-row-testfix into lp:launchpad.
=== modified file 'lib/lp/registry/browser/tests/test_distroseries.py'
--- lib/lp/registry/browser/tests/test_distroseries.py 2011-11-17 16:53:41 +0000
+++ lib/lp/registry/browser/tests/test_distroseries.py 2011-11-18 15:39:36 +0000
@@ -1514,11 +1514,11 @@
root = html.fromstring(view())
[creator_cell] = root.cssselect(
"table.listing tbody td.last-changed")
- self.assertEqual(
- "a moment ago by %s (uploaded by %s)" % (
+ matches = DocTestMatches(
+ "... ago by %s (uploaded by %s)" % (
dsd.source_package_release.creator.displayname,
- dsd.source_package_release.dscsigningkey.owner.displayname),
- normalize_whitespace(creator_cell.text_content()))
+ dsd.source_package_release.dscsigningkey.owner.displayname))
+ self.assertThat(creator_cell.text_content(), matches)
def test_diff_row_links_to_parent_changelog(self):
# After the parent's version, there should be text "(changelog)"
@@ -2572,10 +2572,10 @@
root = html.fromstring(view())
[creator_cell] = root.cssselect(
"table.listing tbody td.last-changed")
- self.assertEqual(
- "a moment ago by %s" % (
- dsd.parent_source_package_release.creator.displayname,),
- normalize_whitespace(creator_cell.text_content()))
+ matches = DocTestMatches(
+ "... ago by %s" % (
+ dsd.parent_source_package_release.creator.displayname,))
+ self.assertThat(creator_cell.text_content(), matches)
def test_diff_row_last_changed_also_shows_uploader_if_different(self):
# When the SPR creator and uploader are different both are named on
@@ -2594,11 +2594,11 @@
[creator_cell] = root.cssselect(
"table.listing tbody td.last-changed")
parent_spr = dsd.parent_source_package_release
- self.assertEqual(
- "a moment ago by %s (uploaded by %s)" % (
+ matches = DocTestMatches(
+ "... ago by %s (uploaded by %s)" % (
parent_spr.creator.displayname,
- parent_spr.dscsigningkey.owner.displayname),
- normalize_whitespace(creator_cell.text_content()))
+ parent_spr.dscsigningkey.owner.displayname))
+ self.assertThat(creator_cell.text_content(), matches)
class DistroSerieUniquePackageDiffsTestCase(TestCaseWithFactory,