def setUp(self): self.address = generate_address() self.client = generate_customer() self.client.add_address(self.address) self.project = generate_project() self.customer_id = get_smallinvoice().clients.add(self.client) self.project.client_id = self.customer_id self.project_id = get_smallinvoice().projects.add(self.project)
def setUp(self): self.address = generate_address() self.client = generate_customer() self.client.add_address(self.address) self.project = generate_project() self.customer_id = get_smallinvoice().clients.add(self.client) self.project.client_id = self.customer_id self.project_id = get_smallinvoice().projects.add(self.project)
def test_email_offer(self): r = Recipient(cc=False, email="*****@*****.**", name="Test Name") m = Mail(subject="Testsubject", body="Test email body", sendstatus=1, afterstatus=1) m.add_recipient(r) m.id = self.offer_id get_smallinvoice().offers.email(m.id, m) self.assertEqual(m.id, self.offer_id)
def test_email_receipt(self): r = Recipient(cc=False, email="*****@*****.**", name="Test Name") m = Mail(subject="Testsubject", body="Test email body", sendstatus=1, afterstatus=1) m.add_recipient(r) m.id = self.receipt_id get_smallinvoice().receipts.email(m.id, m) self.assertEqual(m.id, self.receipt_id)
def test_list_client_accounts(self): data = get_smallinvoice().clientaccounts.all(self.client_id) self.assertEquals(0, len(data)) from smallinvoice.clientaccounts import ClientAccount ca = ClientAccount(number=121312313, swift='ABBCCHZZ', clearing='ATBLZ12345', name='tests') get_smallinvoice().clientaccounts.add(self.client_id, ca) data = get_smallinvoice().clientaccounts.all(self.client_id) self.assertEquals(1, len(data))
def test_update_client_accounts(self): from smallinvoice.clientaccounts import ClientAccount ca = ClientAccount(number=121312313, swift='ABBCCHZZ', clearing='ATBLZ12345', name='tests') id = get_smallinvoice().clientaccounts.add(self.client_id, ca) client_account_data = get_smallinvoice().clientaccounts.get(self.client_id, id) self.assertEqual(ca.number, client_account_data['number']) ca.number = 000101010 get_smallinvoice().clientaccounts.update(self.client_id, ca, id) client_account_data = get_smallinvoice().clientaccounts.get(self.client_id, id) self.assertEqual(ca.number, client_account_data['number'])
def setUp(self): self.address = generate_address() self.client = generate_customer() self.client.add_address(self.address) self.letter = generate_letter() self.customer_id = get_smallinvoice().clients.add(self.client) self.letter.client_id = self.customer_id test = get_smallinvoice().clients.details(self.customer_id) self.letter.client_address_id = test['main_address_id'] self.letter_id = get_smallinvoice().letters.add(self.letter)
def setUp(self): self.address = generate_address() self.client = generate_customer() self.client.add_address(self.address) self.letter = generate_letter() self.customer_id = get_smallinvoice().clients.add(self.client) self.letter.client_id = self.customer_id test = get_smallinvoice().clients.details(self.customer_id) self.letter.client_address_id = test['main_address_id'] self.letter_id = get_smallinvoice().letters.add(self.letter)
def setUp(self): self.address = generate_address() self.client = generate_customer() self.client.add_address(self.address) self.position = generate_position() self.receipt = generate_receipt() self.receipt.add_position(self.position) self.customer_id = get_smallinvoice().clients.add(self.client) self.receipt.client_id = self.customer_id test = get_smallinvoice().clients.details(self.customer_id) self.receipt.client_address_id = test['main_address_id'] self.receipt_id = get_smallinvoice().receipts.add(self.receipt)
def setUp(self): self.address = generate_address() self.client = generate_customer() self.client.add_address(self.address) self.position = generate_position() self.receipt = generate_receipt() self.receipt.add_position(self.position) self.customer_id = get_smallinvoice().clients.add(self.client) self.receipt.client_id = self.customer_id test = get_smallinvoice().clients.details(self.customer_id) self.receipt.client_address_id = test['main_address_id'] self.receipt_id = get_smallinvoice().receipts.add(self.receipt)
def setUp(self): self.address = generate_address() self.client = generate_customer() self.client.add_address(self.address) self.position = generate_position() self.invoice = generate_invoice() self.invoice.period = INVOICE_PERIOD self.invoice.add_position(self.position) self.customer_id = get_smallinvoice().clients.add(self.client) self.invoice.client_id = self.customer_id test = get_smallinvoice().clients.details(self.customer_id) self.invoice.client_address_id = test['main_address_id'] self.invoice_id = get_smallinvoice().invoices.add(self.invoice)
def test_letter_preview(self): preview = get_smallinvoice().letters.preview(self.letter_id, 1, PREVIEW_SIZE.SMALL) self.assertTrue(len(preview) > 0)
def test_status_receipt(self): s = ReceiptState(status=ReceiptState.PAID) get_smallinvoice().receipts.status(self.receipt_id, data=s) self.assertTrue(get_smallinvoice().receipts.details(self.receipt_id) ["status"] == 10)
def tearDown(self): get_smallinvoice().clients.delete(self.client_id)
def tearDown(self): get_smallinvoice().times.delete(self.time_id)
def setUp(self): self.a = generate_assign() self.assign_id = get_smallinvoice().assigns.add(self.a)
def setUp(self): self.c = generate_catalog() self.catalog_id = get_smallinvoice().catalogs.add(self.c)
def test_letter_preview(self): preview = get_smallinvoice().letters.preview(self.letter_id, 1, PREVIEW_SIZE.SMALL) self.assertTrue(len(preview) > 0)
def setUp(self): self.c = generate_catalog() self.catalog_id = get_smallinvoice().catalogs.add(self.c)
def test_invoice_pdf(self): pdf = get_smallinvoice().invoices.pdf(self.invoice_id) self.assertTrue(len(pdf) > 0)
def test_receipt_preview(self): preview = get_smallinvoice().receipts.preview(self.receipt_id, 1, PREVIEW_SIZE.SMALL) self.assertTrue(len(preview) > 0)
def test_receipt_pdf(self): pdf = get_smallinvoice().receipts.pdf(self.receipt_id) self.assertTrue(len(pdf) > 0)
def tearDown(self): get_smallinvoice().clients.delete(self.customer_id) get_smallinvoice().receipts.delete(self.receipt_id)
def tearDown(self): get_smallinvoice().assigns.delete(self.assign_id)
def setUp(self): self.time = generate_time() self.time_id = get_smallinvoice().times.add(self.time)
def setUp(self): self.time = generate_time() self.time_id = get_smallinvoice().times.add(self.time)
def test_letter_pdf(self): pdf = get_smallinvoice().letters.pdf(self.letter_id) self.assertTrue(len(pdf) > 0)
def tearDown(self): get_smallinvoice().times.delete(self.time_id)
def tearDown(self): get_smallinvoice().catalogs.delete(self.catalog_id)
def setUp(self): self.a = generate_account() self.account_id = get_smallinvoice().accounts.add(self.a)
def tearDown(self): get_smallinvoice().clients.delete(self.customer_id) get_smallinvoice().projects.delete(self.project_id)
def tearDown(self): get_smallinvoice().accounts.delete(self.account_id)
def tearDown(self): get_smallinvoice().catalogs.delete(self.catalog_id)
def setUp(self): self.costunit = generate_costunit() self.costunit_id = get_smallinvoice().costunits.add(self.costunit)
def setUp(self): self.address = generate_address() self.client = generate_customer() self.client.add_address(self.address) self.client_id = get_smallinvoice().clients.add(self.client)
def tearDown(self): get_smallinvoice().costunits.delete(self.costunit_id)
def test_letter_pdf(self): pdf = get_smallinvoice().letters.pdf(self.letter_id) self.assertTrue(len(pdf) > 0)
def tearDown(self): get_smallinvoice().clients.delete(self.client_id)
def test_status_letter(self): s = LetterState(status=LetterState.DRAFT) get_smallinvoice().letters.status(self.letter_id, data=s) self.assertTrue(get_smallinvoice().letters.details(self.letter_id) ["status"] == 7)
def test_status_invoice(self): s = InvoiceState(status=InvoiceState.REMINDER) get_smallinvoice().invoices.status(self.invoice_id, data=s) self.assertTrue(get_smallinvoice().invoices.details(self.invoice_id) ["status"] == 3)
def tearDown(self): get_smallinvoice().clients.delete(self.customer_id) get_smallinvoice().invoices.delete(self.invoice_id)
def test_receipt_pdf(self): pdf = get_smallinvoice().receipts.pdf(self.receipt_id) self.assertTrue(len(pdf) > 0)
def test_invoice_preview(self): preview = get_smallinvoice().invoices.preview(self.invoice_id, 1, PREVIEW_SIZE.SMALL) self.assertTrue(len(preview) > 0)
def test_status_letter(self): s = LetterState(status=LetterState.DRAFT) get_smallinvoice().letters.status(self.letter_id, data=s) self.assertTrue( get_smallinvoice().letters.details(self.letter_id)["status"] == 7)
def test_invoiceperiod_field(self): details = get_smallinvoice().invoices.details(self.invoice_id) self.assertEqual(INVOICE_PERIOD, details['period'])
def setUp(self): self.address = generate_address() self.client = generate_customer() self.client.add_address(self.address) self.client_id = get_smallinvoice().clients.add(self.client)
def tearDown(self): get_smallinvoice().clients.delete(self.customer_id) get_smallinvoice().receipts.delete(self.receipt_id)
def test_status_offer(self): s = OfferState(status=OfferState.OK) get_smallinvoice().offers.status(self.offer_id, data=s) self.assertTrue(get_smallinvoice().offers.details(self.offer_id) ["status"] == 9)
def test_receipt_preview(self): preview = get_smallinvoice().receipts.preview(self.receipt_id, 1, PREVIEW_SIZE.SMALL) self.assertTrue(len(preview) > 0)
def tearDown(self): get_smallinvoice().clients.delete(self.customer_id) get_smallinvoice().projects.delete(self.project_id)
def test_status_receipt(self): s = ReceiptState(status=ReceiptState.PAID) get_smallinvoice().receipts.status(self.receipt_id, data=s) self.assertTrue(get_smallinvoice().receipts.details(self.receipt_id) ["status"] == 10)
def tearDown(self): get_smallinvoice().clients.delete(self.customer_id) get_smallinvoice().letters.delete(self.letter_id)