533
533
foo_bugtasks_and_nominations_view.getBugTaskAndNominationViews())
534
534
self.assertEqual([], task_and_nomination_views)
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)
545
view = create_initialized_view(bug, "+bugtasks-and-nominations-table")
546
subviews = view.getBugTaskAndNominationViews()
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])
553
content = subviews[0]()
555
'href="%s"' % canonical_url(
556
series.product, path_only_if_possible=True),
558
self.assertIn(series.product.displayname, content)
537
561
class TestBugTaskEditViewStatusField(TestCaseWithFactory):
538
562
"""We show only those options as possible value in the status