def test_campaigns(self): db = init_db() new_campaign = campaign(desc="Test Campaign") db.add(new_campaign) db.commit() request = db.query(campaign).filter_by(desc="Test Campaign").first() print request.desc self.assertTrue(request.desc is new_campaign.desc)
def handler(): db = init_db() obj = campaign() obj.update(request.POST,db) sess = get_session() current_profile = db.query(profile).filter(profile.id==sess['uid']).first() if current_profile: obj.profiles.append(current_profile) obj.save(session=db) current_profile.campaign.append(obj) current_profile.save(session=db) if obj is None: db.close() return "error" db.close() bottle.redirect(url_root)
def test_merge(self): new_campaign = campaign(desc="Test Campaign")