def setUp(self): create_accounts(self) journ5 = posts.Journals(journalstat = posts.Journals.UNPROCESSED,\ extkey='NR501') journ5.add() journ6 = posts.Journals(journalstat = posts.Journals.UNPROCESSED,\ extkey='NR503') journ6.add() gledger.db.session.flush() self.journ5id = journ5.id self.journ5extkey = journ5.extkey self.journ6id = journ6.id self.journ6extkey = journ6.extkey posting_to_journal(journ5) post9 = posts.Postings( accounts_id=accmodel.Accounts.get_by_name("verkopen").id, journals_id=journ6.id, postmonth=201609, value_date=datetime.now(), amount=20, debcred='Cr') post9.add() post10 = posts.Postings( accounts_id=accmodel.Accounts.get_by_name("kas").id, journals_id=journ6.id, postmonth=201609, value_date=datetime.now(), amount=20, debcred='Db') post10.add()
def setUp(self): create_accounts(self) self.journ13 = posts.Journals(journalstat = posts.Journals.UNPROCESSED,\ extkey='DD956') self.journ13.add() gledger.db.session.flush() posting_to_journal(self.journ13) self.journ14 = posts.Journals(journalstat = posts.Journals.UNPROCESSED,\ extkey='XD952') self.journ14.add() gledger.db.session.flush() posting_to_journal(self.journ14) gledger.db.session.flush()
def setUp(self): for i in range(250, 304): journal = posts.Journals(journalstat=posts.Journals.UNPROCESSED,\ extkey='MLD'+str(i), updated_at=datetime.now()) journal.add() gledger.db.session.flush()
def setUp(self): for i in range(120, 205): journal = posts.Journals(journalstat=posts.Journals.UNPROCESSED,\ extkey='TLV'+str(i), updated_at=datetime.now()) journal.add() gledger.db.session.flush() self.search_list = posts.Journals.journals_for_search( search_string='TLV')
def setUp(self): create_accounts(self) journ8 = posts.Journals(journalstat = posts.Journals.UNPROCESSED,\ extkey='Rs837') journ8.add() posting_to_journal(journ8) gledger.db.session.flush() self.journ8id = journ8.id self.journ8extkey = journ8.extkey
def setUp(self): for i in range(301, 364): journal = posts.Journals(journalstat=posts.Journals.UNPROCESSED,\ extkey='BRH'+str(i), updated_at=datetime.now()) journal.add() gledger.db.session.flush() self.app = gledger.app.test_client() self.app.testing = True
def setUp(self): create_accounts(self) self.journ10 = posts.Journals(journalstat = posts.Journals.UNPROCESSED,\ extkey='RK7098') self.journ10.add() posting_to_journal(self.journ10) gledger.db.session.flush() self.app = gledger.app.test_client() self.app.testing = True
def setUp(self): create_accounts(self) journ7 = posts.Journals(journalstat = posts.Journals.UNPROCESSED,\ extkey='NR723') journ7.add() posting_to_journal(journ7) gledger.db.session.flush() self.journ7id = journ7.id self.journ7extkey = journ7.extkey
def setUp(self): acc3 = accmodel.Accounts(name='verkopen', role='E') acc3.add() acc4 = accmodel.Accounts(name='kas', role='A') acc4.add() acc5 = accmodel.Accounts(name='btw (ontvangen)', role='E') acc5.add() journ2 = posts.Journals(journalstat=posts.Journals.UNPROCESSED, extkey='PP99') journ2.add() gledger.db.session.flush() self.journ2id = journ2.id
def test_post_debcred_invalid(self): """ Posting with invalid debit/credit indicator must be refused """ journ4 = posts.Journals(journalstat=posts.Journals.UNPROCESSED) journ4.add() gledger.db.session.flush() with self.assertRaises(posts.InvalidDebitCreditError): post3 = posts.Postings( accounts_id=accmodel.Accounts.get_by_name("verkopen").id, journals_id=journ4.id, postmonth=201609, value_date=datetime.now(), amount=230, debcred='Ct') gledger.db.session.flush()
def test_post_one_posting(self): """ A posting can be inserted """ post1 = posts.Postings( accounts_id=accmodel.Accounts.get_by_name("verkopen").id, postmonth=201608, value_date=datetime.now(), amount=250, debcred='Cr') journ3 = posts.Journals(journalstat=posts.Journals.UNPROCESSED) journ3.add() journ3.journalpostings.append(post1) post1.add() q = gledger.db.session.query(posts.Postings) self.assertNotEqual(q.count(), 0, 'Posting not inserted')
def setUp(self): create_accounts(self) self.journ12 = posts.Journals(journalstat = posts.Journals.UNPROCESSED,\ extkey='DR990') self.journ12.add() gledger.db.session.flush() posting_amount = 0 for i in range(50): posting_amount += 988 if i > 16: postmonth = 201608 else: postmonth = 201609 create_posting_to_kas(self, posting_amount, postmonth, self.journ12.id) gledger.db.session.flush() self.kas_account = accmodel.Accounts.get_by_name('kas')
def test_insert_journal(self): """A journal can be inserted """ journ1 = posts.Journals(journalstat=posts.Journals.UNPROCESSED) journ1.add() q = gledger.db.session.query(posts.Journals) self.assertNotEqual(q.count(), 0, 'Journal not inserted')