def test_distro_package_alias(self): # Traversing to /+branch/<distro>/<sourcepackage package> redirects # to the page for the branch that is the development focus branch # for that package. sourcepackage = self.factory.makeSourcePackage() branch = self.factory.makePackageBranch(sourcepackage=sourcepackage) distro_package = sourcepackage.distribution_sourcepackage registrant = distro_package.distribution.owner target = ICanHasLinkedBranch(distro_package) with person_logged_in(registrant): target.setBranch(branch, registrant) self.assertRedirects("%s" % target.bzr_path, canonical_url(branch))
def link_func(new_branch): link = ICanHasLinkedBranch(context) link.setBranch(new_branch, requester)