Пример #1
0
 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
Пример #2
0
 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
Пример #3
0
 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
Пример #4
0
 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)
Пример #5
0
    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')