def test_open_team_does_not_have_link(self): # Open teams (a membership policy of Open or Delegated) do not # have a link to create a new PPA. for policy in INCLUSIVE_TEAM_POLICY: team = self.factory.makeTeam(membership_policy=policy) html = self.create_view(team) create_ppa = first_tag_by_class(html, 'menu-link-activate_ppa') self.assertIs(None, create_ppa) message = first_tag_by_class(html, 'cannot-create-ppa-message') self.assertIsNot(None, message)
def test_open_team_does_not_have_link(self): # Open teams (a membership policy of Open or Delegated) do not # have a link to create a new PPA. for policy in INCLUSIVE_TEAM_POLICY: team = self.factory.makeTeam(membership_policy=policy) html = self.create_view(team) create_ppa = first_tag_by_class(html, 'menu-link-activate_ppa') self.assertIs(None, create_ppa) message = first_tag_by_class(html, 'cannot-create-ppa-message') self.assertIsNot(None, message)
def test_closed_teams_has_link(self): # Exclusive teams (a membership policy of Moderated or Restricted) # have a link to create a new PPA. for policy in EXCLUSIVE_TEAM_POLICY: team = self.factory.makeTeam(membership_policy=policy) html = self.create_view(team) create_ppa = first_tag_by_class(html, 'menu-link-activate_ppa') self.assertEqual(create_ppa.get('href'), canonical_url(team, view_name='+activate-ppa')) message = first_tag_by_class(html, 'cannot-create-ppa-message') self.assertIs(None, message)
def test_closed_teams_has_link(self): # Exclusive teams (a membership policy of Moderated or Restricted) # have a link to create a new PPA. for policy in EXCLUSIVE_TEAM_POLICY: team = self.factory.makeTeam(membership_policy=policy) html = self.create_view(team) create_ppa = first_tag_by_class(html, 'menu-link-activate_ppa') self.assertEqual( create_ppa.get('href'), canonical_url(team, view_name='+activate-ppa')) message = first_tag_by_class(html, 'cannot-create-ppa-message') self.assertIs(None, message)
def new_edit_link(self): return first_tag_by_class(self.contents, 'menu-link-edit_bug_mail')
def new_subscribe_link(self): return first_tag_by_class(self.contents, 'menu-link-subscribe_to_bug_mail')
def old_link(self): return first_tag_by_class(self.contents, 'menu-link-subscribe')
def new_edit_link(self): return first_tag_by_class( self.contents, 'menu-link-edit_bug_mail')
def new_subscribe_link(self): return first_tag_by_class( self.contents, 'menu-link-subscribe_to_bug_mail')
def old_link(self): return first_tag_by_class( self.contents, 'menu-link-subscribe')