Example #1
0
    def test_sync_goods(self):
        self.goods_1.clear()
        logic.save_goods(self.goods_1)

        goods_types.test_hero_good.all_goods_for_sync.extend([self.good_2, self.good_4])

        logic.sync_goods(self.account_1.id, None)

        goods_1 = logic.load_goods(self.account_1.id)

        self.assertTrue(goods_1.has_good(self.good_2.uid))
        self.assertFalse(goods_1.has_good(self.good_3.uid))
        self.assertTrue(goods_1.has_good(self.good_4.uid))
Example #2
0
    def test_sync_goods(self):
        self.goods_1.clear()
        logic.save_goods(self.goods_1)

        goods_types.test_hero_good.all_goods_for_sync.extend([self.good_2, self.good_4])

        logic.sync_goods(self.account_1.id, None)

        goods_1 = logic.load_goods(self.account_1.id)

        self.assertTrue(goods_1.has_good(self.good_2.uid))
        self.assertFalse(goods_1.has_good(self.good_3.uid))
        self.assertTrue(goods_1.has_good(self.good_4.uid))
Example #3
0
    def handle(self, *args, **options):

        for hero_model in heroes_model.Hero.objects.all().iterator():
            hero = heroes_logic.load_hero(hero_model=hero_model)
            logic.sync_goods(hero.account_id, hero)
Example #4
0
    def handle(self, *args, **options):

        for hero in heroes_prototypes.HeroPrototype.from_query(
                heroes_prototypes.HeroPrototype._db_all()):
            logic.sync_goods(hero.account_id, hero)
Example #5
0
    def handle(self, *args, **options):

        for hero in heroes_prototypes.HeroPrototype.from_query(heroes_prototypes.HeroPrototype._db_all()):
            logic.sync_goods(hero.account_id, hero)