Exemple #1
0
    def setUp(self):
        self.member = AuthUtils.create_member('auth_member')
        self.member.set_password('password')
        self.member.email = '*****@*****.**'
        self.member.save()
        self.none_user = AuthUtils.create_user('none_user',
                                               disconnect_signals=True)
        self.none_user2 = AuthUtils.create_user('none_user2',
                                                disconnect_signals=True)
        self.none_user3 = AuthUtils.create_user('none_user3',
                                                disconnect_signals=True)

        self.no_perm_user = AuthUtils.create_user('no_perm_user',
                                                  disconnect_signals=True)
        self.no_perm_user.set_password('password')

        AuthUtils.disconnect_signals()
        self.no_perm_group = Group.objects.create(name="No Permission Group")

        self.test_group = Group.objects.create(name="Test group")

        self.test_group.user_set.add(self.none_user)
        self.test_group.user_set.add(self.none_user2)
        self.test_group.user_set.add(self.none_user3)

        self.permission = Permission.objects.get_by_natural_key(
            codename='audit_permissions',
            app_label='permissions_tool',
            model='permissionstool')

        self.test_group.permissions.add(self.permission)
        self.member.user_permissions.add(self.permission)
        AuthUtils.connect_signals()
Exemple #2
0
    def setUp(self):
        self.member = AuthUtils.create_member('auth_member')
        self.member.set_password('password')
        self.member.email = '*****@*****.**'
        self.member.save()
        self.none_user = AuthUtils.create_user('none_user', disconnect_signals=True)
        self.none_user2 = AuthUtils.create_user('none_user2', disconnect_signals=True)
        self.none_user3 = AuthUtils.create_user('none_user3', disconnect_signals=True)

        self.no_perm_user = AuthUtils.create_user('no_perm_user', disconnect_signals=True)
        self.no_perm_user.set_password('password')

        AuthUtils.disconnect_signals()
        self.no_perm_group = Group.objects.create(name="No Permission Group")

        self.test_group = Group.objects.create(name="Test group")

        self.test_group.user_set.add(self.none_user)
        self.test_group.user_set.add(self.none_user2)
        self.test_group.user_set.add(self.none_user3)

        self.permission = Permission.objects.get_by_natural_key(codename='audit_permissions',
                                                                app_label='permissions_tool',
                                                                model='permissionstool')

        self.test_group.permissions.add(self.permission)
        self.member.user_permissions.add(self.permission)
        AuthUtils.connect_signals()
Exemple #3
0
    def setUp(self):
        # Inert signals before setup begins
        with mock.patch(
                MODULE_PATH +
                '.signals.trigger_all_ts_update') as trigger_all_ts_update:
            self.member = 'member_user'
            member = AuthUtils.create_member(self.member)
            Teamspeak3User.objects.create(user=member,
                                          uid=self.member,
                                          perm_key='123ABC')
            self.blue = 'blue_user'
            blue = AuthUtils.create_blue(self.blue)
            Teamspeak3User.objects.create(user=blue,
                                          uid=self.blue,
                                          perm_key='456DEF')
            self.none_user = '******'
            none_user = AuthUtils.create_user(self.none_user)

            ts_member_group = TSgroup.objects.create(ts_group_id=1,
                                                     ts_group_name='Member')
            ts_blue_group = TSgroup.objects.create(ts_group_id=2,
                                                   ts_group_name='Blue')
            m2m_member_group = AuthTS.objects.create(
                auth_group=member.groups.all()[0])
            m2m_member_group.ts_group.add(ts_member_group)
            m2m_member_group.save()
            m2m_blue_group = AuthTS.objects.create(
                auth_group=blue.groups.all()[0])
            m2m_blue_group.ts_group.add(ts_blue_group)
            m2m_blue_group.save()
            self.service = Teamspeak3Service
            add_permissions()
Exemple #4
0
 def setUp(self):
     self.member = 'member_user'
     member = AuthUtils.create_member(self.member)
     Ips4User.objects.create(user=member, id='12345', username=self.member)
     self.blue = 'blue_user'
     blue = AuthUtils.create_blue(self.blue)
     Ips4User.objects.create(user=blue, id='67891', username=self.blue)
     self.none_user = '******'
     none_user = AuthUtils.create_user(self.none_user)
     self.service = Ips4Service
Exemple #5
0
 def setUp(self):
     self.member = 'member_user'
     member = AuthUtils.create_member(self.member)
     DiscordUser.objects.create(user=member, uid='12345')
     self.blue = 'blue_user'
     blue = AuthUtils.create_blue(self.blue)
     DiscordUser.objects.create(user=blue, uid='67891')
     self.none_user = '******'
     none_user = AuthUtils.create_user(self.none_user)
     self.service = DiscordService
Exemple #6
0
 def setUp(self):
     self.member = 'member_user'
     member = AuthUtils.create_member(self.member)
     OpenfireUser.objects.create(user=member, username=self.member)
     self.blue = 'blue_user'
     blue = AuthUtils.create_blue(self.blue)
     OpenfireUser.objects.create(user=blue, username=self.blue)
     self.none_user = '******'
     none_user = AuthUtils.create_user(self.none_user)
     self.service = OpenfireService
Exemple #7
0
 def setUp(self):
     self.member = 'member_user'
     member = AuthUtils.create_member(self.member)
     DiscourseUser.objects.create(user=member, enabled=True)
     self.blue = 'blue_user'
     blue = AuthUtils.create_blue(self.blue)
     DiscourseUser.objects.create(user=blue, enabled=True)
     self.none_user = '******'
     none_user = AuthUtils.create_user(self.none_user)
     self.service = DiscourseService
Exemple #8
0
 def setUp(self):
     self.member = 'member_user'
     member = AuthUtils.create_member(self.member)
     MumbleUser.objects.create(user=member, username=self.member, pwhash='password', groups='Member')
     self.blue = 'blue_user'
     blue = AuthUtils.create_blue(self.blue)
     MumbleUser.objects.create(user=blue, username=self.blue, pwhash='password', groups='Blue')
     self.none_user = '******'
     none_user = AuthUtils.create_user(self.none_user)
     self.service = MumbleService
     add_permissions()
Exemple #9
0
 def setUp(self):
     self.member = 'member_user'
     member = AuthUtils.create_member(self.member)
     SeatUser.objects.create(user=member, username=self.member)
     self.blue = 'blue_user'
     blue = AuthUtils.create_blue(self.blue)
     SeatUser.objects.create(user=blue, username=self.blue)
     self.none_user = '******'
     none_user = AuthUtils.create_user(self.none_user, disconnect_signals=True)
     self.service = SeatService
     add_permissions()
Exemple #10
0
 def setUp(self):
     self.member = 'member_user'
     member = AuthUtils.create_member(self.member)
     DiscordUser.objects.create(user=member, uid='12345')
     self.blue = 'blue_user'
     blue = AuthUtils.create_blue(self.blue)
     DiscordUser.objects.create(user=blue, uid='67891')
     self.none_user = '******'
     none_user = AuthUtils.create_user(self.none_user)
     self.service = DiscordService
     add_permissions()
Exemple #11
0
 def setUp(self):
     self.member = 'member_user'
     member = AuthUtils.create_member(self.member)
     Ips4User.objects.create(user=member, id='12345', username=self.member)
     self.blue = 'blue_user'
     blue = AuthUtils.create_blue(self.blue)
     Ips4User.objects.create(user=blue, id='67891', username=self.blue)
     self.none_user = '******'
     none_user = AuthUtils.create_user(self.none_user)
     self.service = Ips4Service
     add_permissions()
Exemple #12
0
 def setUp(self):
     self.member = 'member_user'
     member = AuthUtils.create_member(self.member)
     DiscourseUser.objects.create(user=member, enabled=True)
     self.blue = 'blue_user'
     blue = AuthUtils.create_blue(self.blue)
     DiscourseUser.objects.create(user=blue, enabled=True)
     self.none_user = '******'
     none_user = AuthUtils.create_user(self.none_user)
     self.service = DiscourseService
     add_permissions()
Exemple #13
0
 def setUp(self):
     self.member = 'member_user'
     member = AuthUtils.create_member(self.member)
     MarketUser.objects.create(user=member, username=self.member)
     self.blue = 'blue_user'
     blue = AuthUtils.create_blue(self.blue)
     MarketUser.objects.create(user=blue, username=self.blue)
     self.none_user = '******'
     none_user = AuthUtils.create_user(self.none_user)
     self.service = MarketService
     add_permissions()
Exemple #14
0
 def setUp(self):
     self.member = 'member_user'
     member = AuthUtils.create_member(self.member)
     SeatUser.objects.create(user=member, username=self.member)
     self.blue = 'blue_user'
     blue = AuthUtils.create_blue(self.blue)
     SeatUser.objects.create(user=blue, username=self.blue)
     self.none_user = '******'
     none_user = AuthUtils.create_user(self.none_user,
                                       disconnect_signals=True)
     self.service = SeatService
     add_permissions()
Exemple #15
0
    def setUp(self):
        # Inert signals before setup begins
        with mock.patch(MODULE_PATH + '.signals.trigger_all_ts_update') as trigger_all_ts_update:
            self.member = 'member_user'
            member = AuthUtils.create_member(self.member)
            Teamspeak3User.objects.create(user=member, uid=self.member, perm_key='123ABC')
            self.blue = 'blue_user'
            blue = AuthUtils.create_blue(self.blue)
            Teamspeak3User.objects.create(user=blue, uid=self.blue, perm_key='456DEF')
            self.none_user = '******'
            none_user = AuthUtils.create_user(self.none_user)

            ts_member_group = TSgroup.objects.create(ts_group_id=1, ts_group_name='Member')
            ts_blue_group = TSgroup.objects.create(ts_group_id=2, ts_group_name='Blue')
            m2m_member_group = AuthTS.objects.create(auth_group=member.groups.all()[0])
            m2m_member_group.ts_group.add(ts_member_group)
            m2m_member_group.save()
            m2m_blue_group = AuthTS.objects.create(auth_group=blue.groups.all()[0])
            m2m_blue_group.ts_group.add(ts_blue_group)
            m2m_blue_group.save()
            self.service = Teamspeak3Service
            add_permissions()
Exemple #16
0
 def setUp(self):
     self.member = AuthUtils.create_member('auth_member')
     self.none_user = AuthUtils.create_user('none_user',
                                            disconnect_signals=True)
Exemple #17
0
 def setUp(self):
     self.member = AuthUtils.create_member('auth_member')
     self.none_user = AuthUtils.create_user('none_user', disconnect_signals=True)