Пример #1
0
 def setUp(self):
     shop_id = 71193535
     campaign_id = 7648334
     adgroup_id = 615482112
     self.datarpt = build_datarpt(shop_id=shop_id,
                                  campaign_id=campaign_id,
                                  adgroup_id=adgroup_id)
Пример #2
0
    def test_config(self):
        shop_id = 71193535
        campaign_id = 33162349
        adgroup_id = 620645850

        data = build_datarpt(shop_id=shop_id,
                             campaign_id=campaign_id,
                             adgroup_id=adgroup_id)
        data.init_report()
        analyze_result = AdgRptAnalyze().analyze(adg_wrapper=data)
        # data.analyze_result = analyze_result
        data.analyze_result.update(analyze_result)
        data.calc_kw_limitprice(kw_g_cpc=analyze_result.get('kw_g_ppc7', 500))

        cmd_cfgs = CommandConfig.objects.filter()
        for kw in data.kw_list:
            kw.is_delete = False
            kw.new_price = None
            kw.new_match_scope = None
            kw.optm_reason = ''
            kw.cmd = ''

            kw_dryrun = KeywordDryRun(kw)

            item = data.item
            adg = data.adgroup
            camp = data.campaign
            mnt_camp = data.mnt_campaign
            cat = data.category
            kw_dryrun.test_run_cmd(cmd_cfgs, data)
Пример #3
0
    def test_config(self):
        shop_id = 71193535
        campaign_id = 33162349
        adgroup_id = 620645850

        CommandConfig.refresh_all_configs()
        StrategyConfig.refresh_all_configs()

        strat_cfgs = strat_cfg_coll.find({}, {'name': 1})
        strat_name_list = [sc['name'] for sc in strat_cfgs]
        strat_name_list.append('undefine')

        data = build_datarpt(shop_id=shop_id,
                             campaign_id=campaign_id,
                             adgroup_id=adgroup_id)
        data.init_report()
        analyze_result = AdgRptAnalyze().analyze(adg_wrapper=data)
        # data.analyze_result = analyze_result
        data.analyze_result.update(analyze_result)
        data.calc_kw_limitprice(kw_g_cpc=analyze_result.get('kw_g_ppc7', 500))
        for strat_name in strat_name_list:
            print '=====================  start %s ====================' % strat_name
            strategy = StrategyFactory().get(name=strat_name)
            strategy.dry_run(data)
            print '=====================  test ok: %s ====================' % strat_name
Пример #4
0
 def setUp(self):
     shop_id = 71193535
     campaign_id = 33162349
     adgroup_id = 620645850
     self.datarpt = build_datarpt(shop_id=shop_id,
                                  campaign_id=campaign_id,
                                  adgroup_id=adgroup_id)
     self.datarpt.init_report()
Пример #5
0
 def setUp(self):
     # shop_id = 7317
     # campaign_id = 2947211
     # adgroup_id = 490060976
     shop_id = 71193535
     campaign_id = 7648334
     adgroup_id = 615482112
     self.datarpt = build_datarpt(shop_id = shop_id, campaign_id = campaign_id, adgroup_id = adgroup_id)
     self.datarpt.init_report()