first commit
This commit is contained in:
2
modules/document_incoming_invoice/tests/__init__.py
Normal file
2
modules/document_incoming_invoice/tests/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,54 @@
|
||||
==================================
|
||||
Document Incoming Invoice Scenario
|
||||
==================================
|
||||
|
||||
Imports::
|
||||
|
||||
>>> from proteus import Model
|
||||
>>> from trytond.modules.account.tests.tools import create_chart, create_fiscalyear
|
||||
>>> from trytond.modules.account_invoice.tests.tools import (
|
||||
... set_fiscalyear_invoice_sequences)
|
||||
>>> from trytond.modules.company.tests.tools import create_company, get_company
|
||||
>>> from trytond.tests.tools import activate_modules, assertEqual
|
||||
|
||||
Activate modules::
|
||||
|
||||
>>> config = activate_modules(
|
||||
... 'document_incoming_invoice', create_company, create_chart)
|
||||
|
||||
>>> Document = Model.get('document.incoming')
|
||||
>>> DocumentConfiguration = Model.get('document.incoming.configuration')
|
||||
>>> Party = Model.get('party.party')
|
||||
|
||||
Get company::
|
||||
|
||||
>>> company = get_company()
|
||||
|
||||
Create fiscal year::
|
||||
|
||||
>>> fiscalyear = set_fiscalyear_invoice_sequences(create_fiscalyear())
|
||||
>>> fiscalyear.click('create_period')
|
||||
|
||||
Set default supplier::
|
||||
|
||||
>>> suppplier = Party(name="Supplier")
|
||||
>>> suppplier.save()
|
||||
|
||||
>>> document_configuration = DocumentConfiguration(1)
|
||||
>>> document_configuration.default_supplier = suppplier
|
||||
>>> document_configuration.save()
|
||||
|
||||
Create incoming document::
|
||||
|
||||
>>> document = Document()
|
||||
>>> document.name = 'invoice.pdf'
|
||||
>>> document.data = b'invoice'
|
||||
>>> document.company = company
|
||||
>>> document.type = 'supplier_invoice'
|
||||
>>> document.save()
|
||||
|
||||
Process document::
|
||||
|
||||
>>> document.click('process')
|
||||
>>> invoice = document.result
|
||||
>>> assertEqual(invoice.party, suppplier)
|
||||
11
modules/document_incoming_invoice/tests/test_module.py
Normal file
11
modules/document_incoming_invoice/tests/test_module.py
Normal file
@@ -0,0 +1,11 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
from trytond.tests.test_tryton import ModuleTestCase
|
||||
|
||||
|
||||
class DocumentIncomingInvoiceTestCase(ModuleTestCase):
|
||||
"Test Document Incoming Invoice module"
|
||||
module = 'document_incoming_invoice'
|
||||
|
||||
|
||||
del ModuleTestCase
|
||||
8
modules/document_incoming_invoice/tests/test_scenario.py
Normal file
8
modules/document_incoming_invoice/tests/test_scenario.py
Normal file
@@ -0,0 +1,8 @@
|
||||
# This file is part of Tryton. The COPYRIGHT file at the top level of
|
||||
# this repository contains the full copyright notices and license terms.
|
||||
|
||||
from trytond.tests.test_tryton import load_doc_tests
|
||||
|
||||
|
||||
def load_tests(*args, **kwargs):
|
||||
return load_doc_tests(__name__, __file__, *args, **kwargs)
|
||||
Reference in New Issue
Block a user