Example #1
0
    def setUpClass(cls):
        super(TestCaseTeamMessages, cls).setUpClass()
        cls.data_utils = data_helpers.DataHelpers()
        cls.a_team_pg = ATeamPage(cls)
        cls.members_tab = members_tab.MembersTab(cls)
        cls.messages_tab = messages_tab.MessagesTab(cls)
        cls.modal = site_modals.SiteModals(cls)
        cls.user_message_pg = user_messages_page.UserMessagesPage(cls)
        cls.non_member = UserFactory()
        cls.admin = UserFactory()
        cls.manager = UserFactory()
        cls.member = UserFactory()

        cls.team = TeamFactory(admin=cls.admin,
                               manager=cls.manager,
                               member=cls.member,
                               )
        cls.team.membership_policy = 1
        cls.team.save()

        #ADD THE TEST MESSAGES TO THE TEST TEAM
        cls.members_tab.open_members_page(cls.team.slug)
        cls.members_tab.log_in(cls.admin.username, 'password')
        cls.messages_tab.open_messages_tab(cls.team.slug)
        cls.messages_tab.edit_messages(cls._TEST_MESSAGES)
Example #2
0
    def setUpClass(cls):
        super(TestCaseTeamMessages, cls).setUpClass()
        cls.data_utils = data_helpers.DataHelpers()
        cls.a_team_pg = ATeamPage(cls)
        cls.members_tab = members_tab.MembersTab(cls)
        cls.messages_tab = messages_tab.MessagesTab(cls)
        cls.user_message_pg = user_messages_page.UserMessagesPage(cls)
        cls.non_member = UserFactory.create(username='******')
        cls.team_owner = UserFactory.create(is_partner = True)

        #CREATE AN APPLICATION-ONLY TEAM 
        cls.team = TeamMemberFactory.create(
            team__membership_policy = 1,
            user = cls.team_owner,
            ).team

        cls.team_member = TeamMemberFactory.create(role="ROLE_CONTRIBUTOR",
                                           user=UserFactory(),
                                           team=cls.team).user

        #ADD THE TEST MESSAGES TO THE TEST TEAM
        cls.members_tab.open_members_page(cls.team.slug)
        cls.members_tab.log_in(cls.team_owner.username, 'password')
        cls.messages_tab.open_messages_tab(cls.team.slug)
        cls.messages_tab.edit_messages(cls._TEST_MESSAGES)
Example #3
0
    def setUpClass(cls):
        super(TestCaseMessageUsers, cls).setUpClass()

        cls.user_message_pg = user_messages_page.UserMessagesPage(cls)
        cls.new_message_pg = new_message_page.NewMessagePage(cls)
        cls.data_utils = data_helpers.DataHelpers()
        cls.admin = UserFactory()
        cls.manager = UserFactory()
        cls.member = UserFactory(notify_by_email=True, is_active=True)
        cls.team1 = TeamFactory(admin=cls.admin,
                               manager=cls.manager,
                               member=cls.member)

        cls.team2 = TeamFactory(admin=cls.admin,
                               manager=cls.manager,
                               member=cls.member)
        cls.users = {
                      #username, langauges-spoken
                      'en_only': ['en'],
                      'en_fr': ['en', 'fr'],
                      'pt_br_fr_de': ['pt-br', 'fr', 'de'],
                      'fil': ['fil'],
                      'de_en': ['de', 'en'],
                      'fr_fil': ['fil', 'fr'],
                    }
        for username, langs in cls.users.iteritems():
            setattr(cls, username, UserFactory(username=username))
            for lc in langs:
                UserLangFactory(user=getattr(cls, username), language=lc)

        #set the team 1 contributors 
        TeamMemberFactory(user=cls.de_en, team=cls.team1,
                          role=TeamMember.ROLE_MANAGER)
        TeamMemberFactory(user=cls.en_only, team=cls.team1,
                          role=TeamMember.ROLE_ADMIN)
        TeamMemberFactory(user=cls.en_fr, team=cls.team1,
                          role=TeamMember.ROLE_ADMIN)
        TeamMemberFactory(user=cls.pt_br_fr_de, team=cls.team1,
                          role=TeamMember.ROLE_CONTRIBUTOR)
        TeamMemberFactory(user=cls.fil, team=cls.team1,
                          role=TeamMember.ROLE_CONTRIBUTOR)

        #set the team 2 contributors 
        TeamMemberFactory(user=cls.en_only, team=cls.team2,
                          role=TeamMember.ROLE_ADMIN)
        TeamMemberFactory(user=cls.de_en, team=cls.team2,
                          role=TeamMember.ROLE_ADMIN)
        TeamMemberFactory(user=cls.en_fr, team=cls.team2,
                          role=TeamMember.ROLE_CONTRIBUTOR)
        TeamMemberFactory(user=cls.pt_br_fr_de, team=cls.team2,
                          role=TeamMember.ROLE_CONTRIBUTOR)
        TeamMemberFactory(user=cls.fr_fil, team=cls.team2,
                          role=TeamMember.ROLE_CONTRIBUTOR)

        cls.new_message_pg.open_page("/")
Example #4
0
    def setUpClass(cls):
        super(TestCaseMessages, cls).setUpClass()
        cls.messages_pg = user_messages_page.UserMessagesPage(cls)
        cls.messages_pg.open_messages()
        cls.data_utils = data_helpers.DataHelpers()
        cls.user = UserFactory()
        cls.staff = UserFactory(is_staff=True, is_superuser=True)
        cls.admin = UserFactory()
        cls.manager = UserFactory()
        cls.member = UserFactory()
        cls.team = TeamFactory(admin=cls.admin,
                               manager=cls.manager,
                               member=cls.member,
                              )

        cls.client = APIClient
Example #5
0
 def setUpClass(cls):
     super(TestCaseMembersTab, cls).setUpClass()
     cls.team_dir_pg = TeamsDirPage(cls)
     cls.user_message_pg = user_messages_page.UserMessagesPage(cls)
     cls.members_tab = members_tab.MembersTab(cls)
     cls.user = UserFactory()
     cls.admin = UserFactory()
     cls.manager = UserFactory()
     cls.member = UserFactory()
     cls.team = TeamFactory(admin=cls.admin,
                            manager=cls.manager,
                            member=cls.member)
     cls.promoted_manager = TeamMemberFactory(
         role=TeamMember.ROLE_CONTRIBUTOR, team=cls.team).user
     cls.promoted_admin = TeamMemberFactory(
         role=TeamMember.ROLE_CONTRIBUTOR, team=cls.team).user
     cls.project = ProjectFactory(team=cls.team)
     cls.members_tab.open_members_page(cls.team.slug)
Example #6
0
    def setUpClass(cls):
        super(TestCaseMessageUsers, cls).setUpClass()

        cls.user_message_pg = user_messages_page.UserMessagesPage(cls)
        cls.new_message_pg = new_message_page.NewMessagePage(cls)
        cls.data_utils = data_helpers.DataHelpers()
        cls.team_owner1 = UserFactory(username='******')
        cls.team_owner2 = UserFactory(username='******')
        cls.team1 = TeamMemberFactory.create(user=cls.team_owner1).team
        cls.team2 = TeamMemberFactory.create(user=cls.team_owner2).team
        cls.logger.info('setup: Create users')
        cls.users = {
                      #username, langauges-spoken
                      'en_only': ['en'],
                      'en_fr': ['en', 'fr'],
                      'pt_br_fr_de': ['pt-br', 'fr', 'de'],
                      'fil': ['fil'],
                      'de_en': ['de', 'en'],
                      'fr_fil': ['fil', 'fr'],
                    }
        cls.team1_managers = ['de_en'] 
        cls.team1_admins = ['en_only', 'en_fr']
        cls.team1_contributors = ['pt_br_fr_de', 'fil']
        cls.team2_admins = ['en_only', 'de_en']
        cls.team2_contributors = ['en_fr', 'pt_br_fr_de', 'fr_fil']



        for username, langs in cls.users.iteritems():
            setattr(cls, username, UserFactory(username=username))
            for lc in langs:
                UserLangFactory(user=getattr(cls, username), language=lc)

        #set the team 1 admins
        for u in cls.team1_admins:
            user = getattr(cls, u)
            TeamMemberFactory.create(
                                     role='ROLE_ADMIN',
                                     team=cls.team1,
                                     user=user)

        #set the team 1 manager 
        for u in cls.team1_managers:
            user = getattr(cls, u)
            TeamMemberFactory.create(
                                     role='ROLE_MANAGER',
                                     team=cls.team1,
                                     user=user)
        #set the team 1 contributors 
        for u in cls.team1_contributors:
            user = getattr(cls, u)
            TeamMemberFactory.create(
                                     role='ROLE_CONTRIBUTOR',
                                     team=cls.team1,
                                     user=user)
        #set the team 2 admins   
        for u in cls.team2_admins:
            user = getattr(cls, u)
            TeamMemberFactory.create(
                                     role='ROLE_ADMIN',
                                     team=cls.team2,
                                     user=user)


        #set the team 2 contributors 
        for u in cls.team2_contributors:
            user = getattr(cls, u)
            TeamMemberFactory.create(
                                     role='ROLE_CONTRIBUTOR',
                                     team=cls.team2,
                                     user=user)

        cls.new_message_pg.open_page("/")