示例#1
0
    def handle(self, *args, **options):

        if pid.check('game_supervisor'):
            print 'game MUST be stopped befor run this command'
            return

        block_expired_accounts()
示例#2
0
    def handle(self, *args, **options):

        for proc in psutil.process_iter():
            try:
                process_cmdline = ' '.join(proc.cmdline())

                if 'django-admin' in process_cmdline and 'supervisor' in process_cmdline and 'the-tale' in process_cmdline:
                    print('game MUST be stopped befor run this command')
                    return
            except psutil.NoSuchProcess:
                pass

        block_expired_accounts()
示例#3
0
    def handle(self, *args, **options):

        for proc in psutil.process_iter():
            try:
                process_cmdline = ' '.join(proc.cmdline())

                if 'django-admin' in process_cmdline and 'supervisor' in process_cmdline and 'the-tale' in process_cmdline:
                    print('game MUST be stopped befor run this command')
                    return
            except psutil.NoSuchProcess:
                pass

        block_expired_accounts()
示例#4
0
    def test_block_expired_accounts(self):
        task = RegistrationTask(account_id=None, referer=None, referral_of_id=None, action_id=None)
        self.assertEqual(task.process(FakePostpondTaskPrototype()), POSTPONED_TASK_LOGIC_RESULT.SUCCESS)

        task.account._model.created_at = datetime.datetime.fromtimestamp(0)
        task.account._model.save()

        self.assertEqual(AccountAchievementsPrototype._db_count(), 1)

        logic.block_expired_accounts()

        self.assertEqual(Hero.objects.all().count(), 0)

        self.assertEqual(Account.objects.all().count(), 0)

        self.assertEqual(AccountAchievementsPrototype._db_count(), 0)
示例#5
0
    def test_block_expired_accounts(self):
        task = RegistrationTask(account_id=None,
                                referer=None,
                                referral_of_id=None,
                                action_id=None)
        self.assertEqual(task.process(FakePostpondTaskPrototype()),
                         POSTPONED_TASK_LOGIC_RESULT.SUCCESS)

        task.account._model.created_at = datetime.datetime.fromtimestamp(0)
        task.account._model.save()

        self.assertEqual(AccountAchievementsPrototype._db_count(), 1)

        logic.block_expired_accounts()

        self.assertEqual(Hero.objects.all().count(), 0)

        self.assertEqual(Account.objects.all().count(), 0)

        self.assertEqual(AccountAchievementsPrototype._db_count(), 0)