def add_call_filter(self, **kwargs): kwargs.setdefault('name', self._random_name()) kwargs.setdefault('type', 'bosssecretary') kwargs.setdefault('tenant_uuid', self.default_tenant.uuid) callfilter = Callfilter(**kwargs) self.add_me(callfilter) return callfilter
def add_bsfilter(self, **kwargs): kwargs.setdefault('callfrom', 'internal') kwargs.setdefault('type', 'bosssecretary') kwargs.setdefault('name', 'bsfilter') kwargs.setdefault('description', '') kwargs.setdefault('commented', 0) kwargs.setdefault('tenant_uuid', self.default_tenant.uuid) callfilter = Callfilter(**kwargs) self.add_me(callfilter) return callfilter
def _insert_call_filter(self, name): callfilter = Callfilter() callfilter.callfrom = 'internal' callfilter.type = 'bosssecretary' callfilter.bosssecretary = 'bossfirst-serial' callfilter.name = name callfilter.description = '' self.add_me(callfilter) return callfilter.id
def add_user_to_boss_secretary_callfilter(self, userid, callfilter_name): callfilter = Callfilter(type='bosssecretary', name=callfilter_name, bosssecretary='secretary-simult', callfrom='all', description='') self.add_me(callfilter) member = Callfiltermember(type='user', typeval=str(userid), callfilterid=callfilter.id, bstype='boss') self.add_me(member)
def test_add(self): callfilter = Callfilter() callfilter.callfrom = 'internal' callfilter.type = 'bosssecretary' callfilter.bosssecretary = 'bossfirst-serial' callfilter.name = 'test' callfilter.description = '' callfilter_dao.add(callfilter) result = self.session.query(Callfilter).first() self.assertEquals(result.name, 'test')