コード例 #1
0
 def testCreate(self):
     profile = Profile(ProfileTest.conn)
     profile['advertiser_id'] = 136402
     profile['deal_targets'] = [{'id': 1999}]
     profile['domain_targets'] = [{'domain': 'www.espn.com'}]
     result = profile.create()
     assert result == profile.get('id')
コード例 #2
0
ファイル: campaign.py プロジェクト: arunvsuresh/appnexus-api
    def get_profile(self):
        if self.get('profile_id') > 0:
            if self.profile_obj is None:
                self.profile_obj = Profile(Campaign.connection).find_one(self.get('profile_id'), self.get('advertiser_id'))
        else:
            new_profile = Profile(Campaign.connection)
            new_profile['advertiser_id'] = self.get('advertiser_id')
            new_profile.create()
            self.profile_obj = new_profile
            self['profile_id'] = new_profile.get('id')

        return self.profile_obj
コード例 #3
0
 def testGetById(self):
     profile_id = 423662
     advertiser_id = 136402
     loader = Profile(ProfileTest.conn)
     profile = loader.find_one(profile_id, advertiser_id)
     assert profile_id == profile.get('id')
コード例 #4
0
 def testGet(self):
     loader = Profile(ProfileTest.conn)
     profiles = loader.find()
     for profile in profiles:
         assert profile.get('id') is not None