示例#1
0
 def setUp(self):
     self.member = AuthUtils.create_member('auth_member')
     self.member.set_password('password')
     self.member.email = '*****@*****.**'
     self.member.save()
     AuthUtils.add_main_character(self.member, 'auth_member', '12345', corp_id='111', corp_name='Test Corporation')
     add_permissions()
示例#2
0
    def test_sync_nickname(self, manager):
        service = self.service()
        member = User.objects.get(username=self.member)
        AuthUtils.add_main_character(member, 'test user', '12345', corp_ticker='AAUTH')

        service.sync_nickname(member)

        self.assertTrue(manager.update_nickname.called)
        args, kwargs = manager.update_nickname.call_args
        self.assertEqual(args[0], member.discord.uid)
        self.assertEqual(args[1], 'test user')
示例#3
0
    def test_sync_nickname(self, manager):
        service = self.service()
        member = User.objects.get(username=self.member)
        AuthUtils.add_main_character(member, 'test user', '12345', corp_ticker='AAUTH')

        service.sync_nickname(member)

        self.assertTrue(manager.update_nickname.called)
        args, kwargs = manager.update_nickname.call_args
        self.assertEqual(args[0], member.discord.uid)
        self.assertEqual(args[1], 'test user')
示例#4
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 = AuthUtils.create_member('auth_member')
            self.member.set_password('password')
            self.member.email = '*****@*****.**'
            self.member.save()
            AuthUtils.add_main_character(self.member, 'auth_member', '12345', corp_id='111', corp_name='Test Corporation')
            self.blue_user = AuthUtils.create_blue('auth_blue')
            self.blue_user.set_password('password')
            self.blue_user.email = '*****@*****.**'
            self.blue_user.save()
            AuthUtils.add_main_character(self.blue_user, 'auth_blue', '92345', corp_id='111', corp_name='Test Corporation')

            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 = AuthTS.objects.create(auth_group=Group.objects.get(name='Member'))
            m2m_member.ts_group.add(ts_member_group)
            m2m_member.save()
            m2m_blue = AuthTS.objects.create(auth_group=Group.objects.get(name='Blue'))
            m2m_blue.ts_group.add(ts_blue_group)
            m2m_blue.save()
示例#5
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 = AuthUtils.create_member('auth_member')
            self.member.set_password('password')
            self.member.email = '*****@*****.**'
            self.member.save()
            AuthUtils.add_main_character(self.member, 'auth_member', '12345', corp_id='111', corp_name='Test Corporation')
            self.blue_user = AuthUtils.create_blue('auth_blue')
            self.blue_user.set_password('password')
            self.blue_user.email = '*****@*****.**'
            self.blue_user.save()
            AuthUtils.add_main_character(self.blue_user, 'auth_blue', '92345', corp_id='111', corp_name='Test Corporation')

            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 = AuthTS.objects.create(auth_group=Group.objects.get(name='Member'))
            m2m_member.ts_group.add(ts_member_group)
            m2m_member.save()
            m2m_blue = AuthTS.objects.create(auth_group=Group.objects.get(name='Blue'))
            m2m_blue.ts_group.add(ts_blue_group)
            m2m_blue.save()
            add_permissions()