def test_branch_url(self): """ The L{branch_url} filter returns the URL for the branch page in Launchpad for a L{Bug}'s branch. """ now = datetime.utcnow() bug = Bug("1", "kanban", MEDIUM, IN_PROGRESS, "A title", "jkakar", now, "lp:~username/project/branch") self.assertEqual("https://code.launchpad.net/~username/project/branch", branch_url(bug))
def test_branch_url_with_merge_proposal(self): """ The L{branch_url} filter returns the merge proposal URL for branches that have one. """ now = datetime.utcnow() bug = Bug( "1", "kanban", MEDIUM, IN_PROGRESS, "A title", "jkakar", now, "lp:~username/project/branch", "https://code.launchpad.net/~username/project/branch/+merge/1234", NEEDS_REVIEW, now) self.assertEqual( "https://code.launchpad.net/~username/project/branch/+merge/1234", branch_url(bug))