Example #1
0
    def _insert_funckeys(self):
        fwd_unc = PhoneFunckey()
        fwd_unc.iduserfeatures = self._user_id
        fwd_unc.fknum = 2
        fwd_unc.exten = self._destination_unc
        fwd_unc.typeextenumbers = 'extenfeatures'
        fwd_unc.typevalextenumbers = 'fwdunc'
        fwd_unc.supervision = 1
        fwd_unc.progfunckey = 1

        fwd_unc_no_dest = PhoneFunckey()
        fwd_unc_no_dest.iduserfeatures = self._user_id_no_dest
        fwd_unc_no_dest.fknum = 2
        fwd_unc_no_dest.typeextenumbers = 'extenfeatures'
        fwd_unc_no_dest.typevalextenumbers = 'fwdunc'
        fwd_unc_no_dest.supervision = 1
        fwd_unc_no_dest.progfunckey = 1

        fwd_rna = PhoneFunckey()
        fwd_rna.iduserfeatures = self._user_id
        fwd_rna.fknum = 3
        fwd_rna.exten = self._destination_rna
        fwd_rna.typeextenumbers = 'extenfeatures'
        fwd_rna.typevalextenumbers = 'fwdrna'
        fwd_rna.supervision = 1
        fwd_rna.progfunckey = 1

        self.session.begin()
        self.session.add(fwd_unc)
        self.session.add(fwd_unc_no_dest)
        self.session.add(fwd_rna)
        self.session.commit()
Example #2
0
    def test_add(self):
        fwd_unc = PhoneFunckey()
        fwd_unc.iduserfeatures = self._user_id
        fwd_unc.fknum = 9
        fwd_unc.exten = self._destination_unc
        fwd_unc.typeextenumbers = 'extenfeatures'
        fwd_unc.typevalextenumbers = 'fwdunc'
        fwd_unc.supervision = 1
        fwd_unc.progfunckey = 1
        fwd_unc.label = 'my label for test_add'

        phonefunckey_dao.add(fwd_unc)
        new_funckey = (self.session.query(PhoneFunckey)
                           .filter(PhoneFunckey.label == 'my label for test_add')
                           .first())
        self.assertEquals(fwd_unc, new_funckey)