~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/registry/browser/tests/test_distroseries.py

  • Committer: Gavin Panella
  • Date: 2011-11-18 15:25:51 UTC
  • mto: This revision was merged to the branch mainline in revision 14328.
  • Revision ID: gavin.panella@canonical.com-20111118152551-zpnfpuxo4wzdc7w1
Don't match against 'a moment ago' because it might not be.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1514
1514
        root = html.fromstring(view())
1515
1515
        [creator_cell] = root.cssselect(
1516
1516
            "table.listing tbody td.last-changed")
1517
 
        self.assertEqual(
1518
 
            "a moment ago by %s (uploaded by %s)" % (
 
1517
        matches = DocTestMatches(
 
1518
            "... ago by %s (uploaded by %s)" % (
1519
1519
                dsd.source_package_release.creator.displayname,
1520
 
                dsd.source_package_release.dscsigningkey.owner.displayname),
1521
 
            normalize_whitespace(creator_cell.text_content()))
 
1520
                dsd.source_package_release.dscsigningkey.owner.displayname))
 
1521
        self.assertThat(creator_cell.text_content(), matches)
1522
1522
 
1523
1523
    def test_diff_row_links_to_parent_changelog(self):
1524
1524
        # After the parent's version, there should be text "(changelog)"
2572
2572
            root = html.fromstring(view())
2573
2573
        [creator_cell] = root.cssselect(
2574
2574
            "table.listing tbody td.last-changed")
2575
 
        self.assertEqual(
2576
 
            "a moment ago by %s" % (
2577
 
                dsd.parent_source_package_release.creator.displayname,),
2578
 
            normalize_whitespace(creator_cell.text_content()))
 
2575
        matches = DocTestMatches(
 
2576
            "... ago by %s" % (
 
2577
                dsd.parent_source_package_release.creator.displayname,))
 
2578
        self.assertThat(creator_cell.text_content(), matches)
2579
2579
 
2580
2580
    def test_diff_row_last_changed_also_shows_uploader_if_different(self):
2581
2581
        # When the SPR creator and uploader are different both are named on
2594
2594
        [creator_cell] = root.cssselect(
2595
2595
            "table.listing tbody td.last-changed")
2596
2596
        parent_spr = dsd.parent_source_package_release
2597
 
        self.assertEqual(
2598
 
            "a moment ago by %s (uploaded by %s)" % (
 
2597
        matches = DocTestMatches(
 
2598
            "... ago by %s (uploaded by %s)" % (
2599
2599
                parent_spr.creator.displayname,
2600
 
                parent_spr.dscsigningkey.owner.displayname),
2601
 
            normalize_whitespace(creator_cell.text_content()))
 
2600
                parent_spr.dscsigningkey.owner.displayname))
 
2601
        self.assertThat(creator_cell.text_content(), matches)
2602
2602
 
2603
2603
 
2604
2604
class DistroSerieUniquePackageDiffsTestCase(TestCaseWithFactory,