~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/bugs/browser/tests/test_bugtask.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-08-03 05:00:46 UTC
  • mfrom: (13543.10.3 ghostly-series-tasks)
  • Revision ID: launchpad@pqm.canonical.com-20110803050046-d5b26bk2fqw9zm3a
[r=stevenk][bug=817336] Always show a row for a series task's parent
 context, even if there is no actual task for the parent.

Show diffs side-by-side

added added

removed removed

Lines of Context:
533
533
            foo_bugtasks_and_nominations_view.getBugTaskAndNominationViews())
534
534
        self.assertEqual([], task_and_nomination_views)
535
535
 
 
536
    def test_bugtarget_parent_shown_for_orphaned_series_tasks(self):
 
537
        # Test that a row is shown for the parent of a series task, even
 
538
        # if the parent doesn't actually have a task.
 
539
        series = self.factory.makeProductSeries()
 
540
        bug = self.factory.makeBug(series=series)
 
541
        self.assertEqual(2, len(bug.bugtasks))
 
542
        new_prod = self.factory.makeProduct()
 
543
        bug.getBugTask(series.product).transitionToTarget(new_prod)
 
544
 
 
545
        view = create_initialized_view(bug, "+bugtasks-and-nominations-table")
 
546
        subviews = view.getBugTaskAndNominationViews()
 
547
        self.assertEqual([
 
548
            (series.product, '+bugtasks-and-nominations-table-row'),
 
549
            (bug.getBugTask(series), '+bugtasks-and-nominations-table-row'),
 
550
            (bug.getBugTask(new_prod), '+bugtasks-and-nominations-table-row'),
 
551
            ], [(v.context, v.__name__) for v in subviews])
 
552
 
 
553
        content = subviews[0]()
 
554
        self.assertIn(
 
555
            'href="%s"' % canonical_url(
 
556
                series.product, path_only_if_possible=True),
 
557
            content)
 
558
        self.assertIn(series.product.displayname, content)
 
559
 
536
560
 
537
561
class TestBugTaskEditViewStatusField(TestCaseWithFactory):
538
562
    """We show only those options as possible value in the status