formatting
This commit is contained in:
parent
b28723cfb1
commit
0275ee09e9
14 changed files with 411 additions and 344 deletions
|
@ -4,27 +4,14 @@
|
|||
import trytond.tests.test_tryton
|
||||
import unittest
|
||||
|
||||
from trytond.modules.investment.tests.test_asset import AssetTestCase
|
||||
from trytond.modules.investment.tests.test_rate import RateTestCase
|
||||
from trytond.modules.investment.tests.test_source import SourceTestCase
|
||||
from trytond.modules.investment.tests.test_wizard import WizardTestCase
|
||||
from .test_module import InvestmentTestCase
|
||||
|
||||
|
||||
__all__ = ['suite']
|
||||
|
||||
|
||||
class InvestmentTestCase(\
|
||||
WizardTestCase, \
|
||||
SourceTestCase, \
|
||||
RateTestCase,\
|
||||
AssetTestCase,\
|
||||
):
|
||||
'Test investment module'
|
||||
module = 'investment'
|
||||
|
||||
# end InvestmentTestCase
|
||||
|
||||
def suite():
|
||||
suite = trytond.tests.test_tryton.suite()
|
||||
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(InvestmentTestCase))
|
||||
suite.addTests(unittest.TestLoader().loadTestsFromTestCase(
|
||||
InvestmentTestCase))
|
||||
return suite
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# 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, with_transaction
|
||||
from trytond.tests.test_tryton import with_transaction
|
||||
from trytond.pool import Pool
|
||||
from trytond.modules.company.tests import create_company
|
||||
from trytond.transaction import Transaction
|
||||
|
@ -12,10 +12,9 @@ from decimal import Decimal
|
|||
from datetime import time, date, datetime
|
||||
|
||||
|
||||
class AssetTestCase(ModuleTestCase):
|
||||
'Test asset module'
|
||||
module = 'investment'
|
||||
|
||||
class AssetTestCase(object):
|
||||
""" test asset
|
||||
"""
|
||||
def prep_asset_company(self):
|
||||
""" get/create company
|
||||
"""
|
||||
|
@ -24,11 +23,13 @@ class AssetTestCase(ModuleTestCase):
|
|||
company = Company.search([])
|
||||
if len(company) > 0:
|
||||
company = company[0]
|
||||
else :
|
||||
else:
|
||||
company = create_company(name='m-ds')
|
||||
return company
|
||||
|
||||
def prep_asset_product(self, name='Product 1', description=None, unit='u', unit_name='Units'):
|
||||
def prep_asset_product(
|
||||
self, name='Product 1', description=None, unit='u',
|
||||
unit_name='Units'):
|
||||
""" create product
|
||||
"""
|
||||
pool = Pool()
|
||||
|
@ -85,7 +86,7 @@ class AssetTestCase(ModuleTestCase):
|
|||
|
||||
asset = self.prep_asset_item(
|
||||
company=company,
|
||||
product = product)
|
||||
product=product)
|
||||
self.assertEqual(asset.symbol, 'usd/u')
|
||||
self.assertEqual(asset.asset_symbol.symbol, 'usd/u')
|
||||
|
||||
|
@ -95,7 +96,8 @@ class AssetTestCase(ModuleTestCase):
|
|||
{
|
||||
'currency_digits': 1,
|
||||
}])
|
||||
self.assertRaisesRegex(UserError,
|
||||
self.assertRaisesRegex(
|
||||
UserError,
|
||||
'ss',
|
||||
Asset.write,
|
||||
*[[asset], {
|
||||
|
@ -115,7 +117,7 @@ class AssetTestCase(ModuleTestCase):
|
|||
|
||||
asset = self.prep_asset_item(
|
||||
company=company,
|
||||
product = product)
|
||||
product=product)
|
||||
|
||||
self.assertEqual(asset.rec_name, 'Product 1 | - usd/u | -')
|
||||
|
||||
|
@ -127,7 +129,9 @@ class AssetTestCase(ModuleTestCase):
|
|||
'rate': Decimal('2.45'),
|
||||
}])],
|
||||
}])
|
||||
self.assertEqual(asset.rec_name, 'Product 1 | 2.4500 usd/u | 05/15/2022')
|
||||
self.assertEqual(
|
||||
asset.rec_name,
|
||||
'Product 1 | 2.4500 usd/u | 05/15/2022')
|
||||
self.assertEqual(Asset.search_count([('name', '=', 'Product 1')]), 1)
|
||||
|
||||
@with_transaction()
|
||||
|
@ -146,10 +150,10 @@ class AssetTestCase(ModuleTestCase):
|
|||
|
||||
asset1 = self.prep_asset_item(
|
||||
company=company,
|
||||
product = product1)
|
||||
product=product1)
|
||||
asset2 = self.prep_asset_item(
|
||||
company=company,
|
||||
product = product2)
|
||||
product=product2)
|
||||
|
||||
Asset.write(*[
|
||||
[asset1],
|
||||
|
@ -173,8 +177,12 @@ class AssetTestCase(ModuleTestCase):
|
|||
}])],
|
||||
},
|
||||
])
|
||||
self.assertEqual(asset1.rec_name, 'Product 1 | 3.5000 usd/u | 05/18/2022')
|
||||
self.assertEqual(asset2.rec_name, 'Product 2 | 2.6000 usd/u | 05/17/2022')
|
||||
self.assertEqual(
|
||||
asset1.rec_name,
|
||||
'Product 1 | 3.5000 usd/u | 05/18/2022')
|
||||
self.assertEqual(
|
||||
asset2.rec_name,
|
||||
'Product 2 | 2.6000 usd/u | 05/17/2022')
|
||||
|
||||
assets = Asset.search([], order=[('date', 'ASC')])
|
||||
self.assertEqual(len(assets), 2)
|
||||
|
@ -221,7 +229,7 @@ class AssetTestCase(ModuleTestCase):
|
|||
|
||||
asset1 = self.prep_asset_item(
|
||||
company=company,
|
||||
product = product)
|
||||
product=product)
|
||||
self.assertEqual(asset1.rec_name, 'Product 1 | - usd/u | -')
|
||||
|
||||
Asset.write(*[
|
||||
|
@ -242,7 +250,9 @@ class AssetTestCase(ModuleTestCase):
|
|||
}])],
|
||||
},
|
||||
])
|
||||
self.assertEqual(asset1.rec_name, 'Product 1 | 2.6000 usd/u | 05/16/2022')
|
||||
self.assertEqual(
|
||||
asset1.rec_name,
|
||||
'Product 1 | 2.6000 usd/u | 05/16/2022')
|
||||
self.assertEqual(len(asset1.rates), 4)
|
||||
self.assertEqual(asset1.rates[0].date, date(2022, 5, 16))
|
||||
self.assertEqual(asset1.rates[1].date, date(2022, 5, 15))
|
||||
|
@ -252,13 +262,12 @@ class AssetTestCase(ModuleTestCase):
|
|||
# query fixed date
|
||||
tab_percent = Asset.get_percentage_sql(days=0)
|
||||
with Transaction().set_context({
|
||||
'qdate': date(2022, 5, 16),
|
||||
}):
|
||||
'qdate': date(2022, 5, 16)}):
|
||||
query = tab_percent.select(
|
||||
tab_percent.id,
|
||||
tab_percent.date,
|
||||
tab_percent.percent,
|
||||
where=tab_percent.id==asset1.id,
|
||||
where=tab_percent.id == asset1.id,
|
||||
)
|
||||
cursor.execute(*query)
|
||||
records = cursor.fetchall()
|
||||
|
@ -268,7 +277,9 @@ class AssetTestCase(ModuleTestCase):
|
|||
self.assertEqual(len(records[0]), 3)
|
||||
self.assertEqual(records[0][0], asset1.id)
|
||||
self.assertEqual(records[0][1], date(2022, 5, 16))
|
||||
self.assertEqual(records[0][2].quantize(Decimal('0.01')), Decimal('6.12'))
|
||||
self.assertEqual(
|
||||
records[0][2].quantize(Decimal('0.01')),
|
||||
Decimal('6.12'))
|
||||
|
||||
@with_transaction()
|
||||
def test_asset_percentages_daterange(self):
|
||||
|
@ -284,10 +295,10 @@ class AssetTestCase(ModuleTestCase):
|
|||
|
||||
asset1 = self.prep_asset_item(
|
||||
company=company,
|
||||
product = product)
|
||||
product=product)
|
||||
asset2 = self.prep_asset_item(
|
||||
company=company,
|
||||
product = product)
|
||||
product=product)
|
||||
|
||||
self.assertEqual(asset1.rec_name, 'Product 1 | - usd/u | -')
|
||||
self.assertEqual(asset2.rec_name, 'Product 1 | - usd/u | -')
|
||||
|
@ -314,8 +325,12 @@ class AssetTestCase(ModuleTestCase):
|
|||
}])],
|
||||
},
|
||||
])
|
||||
self.assertEqual(asset1.rec_name, 'Product 1 | 2.6000 usd/u | 05/16/2022')
|
||||
self.assertEqual(asset2.rec_name, 'Product 1 | 5.2500 usd/u | 05/15/2022')
|
||||
self.assertEqual(
|
||||
asset1.rec_name,
|
||||
'Product 1 | 2.6000 usd/u | 05/16/2022')
|
||||
self.assertEqual(
|
||||
asset2.rec_name,
|
||||
'Product 1 | 5.2500 usd/u | 05/15/2022')
|
||||
self.assertEqual(asset1.change_day1, Decimal('6.12'))
|
||||
self.assertEqual(asset2.change_day1, Decimal('-8.7'))
|
||||
self.assertEqual(asset1.change_month1, None)
|
||||
|
@ -390,7 +405,7 @@ class AssetTestCase(ModuleTestCase):
|
|||
|
||||
asset1 = self.prep_asset_item(
|
||||
company=company,
|
||||
product = product)
|
||||
product=product)
|
||||
|
||||
self.assertEqual(asset1.rec_name, 'Product 1 | - usd/u | -')
|
||||
|
||||
|
@ -411,7 +426,9 @@ class AssetTestCase(ModuleTestCase):
|
|||
'rate': Decimal('2.8'),
|
||||
},])],
|
||||
}])
|
||||
self.assertEqual(asset1.rec_name, 'Product 1 | 2.6000 usd/u | 05/16/2022')
|
||||
self.assertEqual(
|
||||
asset1.rec_name,
|
||||
'Product 1 | 2.6000 usd/u | 05/16/2022')
|
||||
self.assertEqual(len(asset1.rates), 4)
|
||||
self.assertEqual(asset1.rates[0].date, date(2022, 5, 16))
|
||||
self.assertEqual(asset1.rates[1].date, date(2022, 5, 15))
|
||||
|
@ -465,7 +482,6 @@ class AssetTestCase(ModuleTestCase):
|
|||
"""
|
||||
pool = Pool()
|
||||
OnlineSource = pool.get('investment.source')
|
||||
Asset = pool.get('investment.asset')
|
||||
|
||||
company = self.prep_asset_company()
|
||||
product = self.prep_asset_product(
|
||||
|
@ -474,14 +490,14 @@ class AssetTestCase(ModuleTestCase):
|
|||
|
||||
asset = self.prep_asset_item(
|
||||
company=company,
|
||||
product = product)
|
||||
product=product)
|
||||
|
||||
o_source, = OnlineSource.create([{
|
||||
'name': 'Source 1',
|
||||
}])
|
||||
|
||||
self.assertEqual(len(asset.updtsources), 0)
|
||||
self.assertEqual(asset.updttime, time(14,0))
|
||||
self.assertEqual(asset.updttime, time(14, 0))
|
||||
|
||||
asset.updtsources = [o_source]
|
||||
asset.updttime = time(10, 45)
|
||||
|
@ -511,7 +527,7 @@ class AssetTestCase(ModuleTestCase):
|
|||
|
||||
asset = self.prep_asset_item(
|
||||
company=company,
|
||||
product = product)
|
||||
product=product)
|
||||
|
||||
o_source, = OnlineSource.create([{
|
||||
'name': 'Source 1',
|
||||
|
@ -524,8 +540,8 @@ class AssetTestCase(ModuleTestCase):
|
|||
}])
|
||||
|
||||
with Transaction().set_context({
|
||||
'qdate': date(2022, 10, 14), # friday
|
||||
}):
|
||||
|
||||
'qdate': date(2022, 10, 14)}):
|
||||
# re-read to make context work
|
||||
asset2, = Asset.browse([asset.id])
|
||||
|
||||
|
@ -539,10 +555,12 @@ class AssetTestCase(ModuleTestCase):
|
|||
self.assertEqual(asset2.nextupdate, datetime(2022, 10, 17, 10, 45))
|
||||
|
||||
self.assertEqual(
|
||||
Asset.search_count([('nextupdate', '<', datetime(2022, 10, 17, 10, 45))]),
|
||||
Asset.search_count([
|
||||
('nextupdate', '<', datetime(2022, 10, 17, 10, 45))]),
|
||||
0)
|
||||
self.assertEqual(
|
||||
Asset.search_count([('nextupdate', '>=', datetime(2022, 10, 17, 10, 45))]),
|
||||
Asset.search_count([
|
||||
('nextupdate', '>=', datetime(2022, 10, 17, 10, 45))]),
|
||||
1)
|
||||
|
||||
# add rate at next monday
|
||||
|
@ -550,7 +568,7 @@ class AssetTestCase(ModuleTestCase):
|
|||
[asset],
|
||||
{
|
||||
'rates': [('create', [{
|
||||
'date': date(2022, 10, 17), # monday
|
||||
'date': date(2022, 10, 17), # monday
|
||||
'rate': Decimal('1.5'),
|
||||
}])],
|
||||
}])
|
||||
|
@ -564,10 +582,12 @@ class AssetTestCase(ModuleTestCase):
|
|||
self.assertEqual(asset.nextupdate, datetime(2022, 10, 18, 10, 45))
|
||||
|
||||
self.assertEqual(
|
||||
Asset.search_count([('nextupdate', '<', datetime(2022, 10, 18, 10, 45))]),
|
||||
Asset.search_count([
|
||||
('nextupdate', '<', datetime(2022, 10, 18, 10, 45))]),
|
||||
0)
|
||||
self.assertEqual(
|
||||
Asset.search_count([('nextupdate', '>=', datetime(2022, 10, 18, 10, 45))]),
|
||||
Asset.search_count([
|
||||
('nextupdate', '>=', datetime(2022, 10, 18, 10, 45))]),
|
||||
1)
|
||||
|
||||
# add rate at today
|
||||
|
@ -589,10 +609,12 @@ class AssetTestCase(ModuleTestCase):
|
|||
self.assertEqual(asset2.nextupdate, datetime(2022, 10, 19, 10, 45))
|
||||
|
||||
self.assertEqual(
|
||||
Asset.search_count([('nextupdate', '<', datetime(2022, 10, 19, 10, 45))]),
|
||||
Asset.search_count([
|
||||
('nextupdate', '<', datetime(2022, 10, 19, 10, 45))]),
|
||||
0)
|
||||
self.assertEqual(
|
||||
Asset.search_count([('nextupdate', '>=', datetime(2022, 10, 19, 10, 45))]),
|
||||
Asset.search_count([
|
||||
('nextupdate', '>=', datetime(2022, 10, 19, 10, 45))]),
|
||||
1)
|
||||
|
||||
@with_transaction()
|
||||
|
@ -609,12 +631,8 @@ class AssetTestCase(ModuleTestCase):
|
|||
product2 = self.prep_asset_product(
|
||||
name='Product gram', unit='g')
|
||||
|
||||
asset1 = self.prep_asset_item(
|
||||
company=company,
|
||||
product = product1)
|
||||
asset2 = self.prep_asset_item(
|
||||
company=company,
|
||||
product = product2)
|
||||
asset1 = self.prep_asset_item(company=company, product=product1)
|
||||
asset2 = self.prep_asset_item(company=company, product=product2)
|
||||
|
||||
Product.write(*[
|
||||
[product1],
|
||||
|
@ -653,9 +671,15 @@ class AssetTestCase(ModuleTestCase):
|
|||
self.assertEqual(Asset.search_count([('isin', '=', 'XC0009655157')]), 1)
|
||||
self.assertEqual(Asset.search_count([('secsymb', '=', '1472977')]), 1)
|
||||
|
||||
self.assertEqual(Asset.search_count([('rec_name', '=', '965515')]), 1)
|
||||
self.assertEqual(Asset.search_count([('rec_name', '=', 'XC0009655157')]), 1)
|
||||
self.assertEqual(Asset.search_count([('rec_name', '=', '1472977')]), 1)
|
||||
self.assertEqual(
|
||||
Asset.search_count([('rec_name', '=', '965515')]),
|
||||
1)
|
||||
self.assertEqual(
|
||||
Asset.search_count([('rec_name', '=', 'XC0009655157')]),
|
||||
1)
|
||||
self.assertEqual(
|
||||
Asset.search_count([('rec_name', '=', '1472977')]),
|
||||
1)
|
||||
|
||||
self.assertEqual(Asset.search_count([('name', '=', '965515')]), 1)
|
||||
self.assertEqual(Asset.search_count([('name', '=', 'XC0009655157')]), 1)
|
||||
|
@ -715,9 +739,7 @@ class AssetTestCase(ModuleTestCase):
|
|||
name='Product gram', unit='g')
|
||||
self.assertEqual(product2.default_uom.digits, 2)
|
||||
|
||||
asset = self.prep_asset_item(
|
||||
company=company,
|
||||
product = product1)
|
||||
asset = self.prep_asset_item(company=company, product=product1)
|
||||
|
||||
self.assertEqual(asset.product.rec_name, 'Product unit')
|
||||
self.assertEqual(asset.product.default_uom.rec_name, 'Unit')
|
|
@ -3,17 +3,15 @@
|
|||
# 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, with_transaction
|
||||
from trytond.tests.test_tryton import with_transaction
|
||||
from trytond.pool import Pool
|
||||
from trytond.modules.company.tests import create_company
|
||||
from decimal import Decimal
|
||||
from datetime import date
|
||||
|
||||
|
||||
class RateTestCase(ModuleTestCase):
|
||||
'Test rate module'
|
||||
module = 'investment'
|
||||
|
||||
class RateTestCase(object):
|
||||
""" test rate
|
||||
"""
|
||||
@with_transaction()
|
||||
def test_rate_create(self):
|
||||
""" create rate
|
||||
|
@ -27,7 +25,7 @@ class RateTestCase(ModuleTestCase):
|
|||
|
||||
asset = self.prep_asset_item(
|
||||
company=company,
|
||||
product = product)
|
||||
product=product)
|
||||
|
||||
Asset.write(*[
|
||||
[asset],
|
|
@ -3,9 +3,8 @@
|
|||
# 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, with_transaction
|
||||
from trytond.tests.test_tryton import with_transaction
|
||||
from trytond.pool import Pool
|
||||
from trytond.modules.company.tests import create_company
|
||||
from trytond.transaction import Transaction
|
||||
from decimal import Decimal
|
||||
from datetime import time, date, datetime
|
||||
|
@ -14,10 +13,9 @@ from requests import Response
|
|||
import requests
|
||||
|
||||
|
||||
class SourceTestCase(ModuleTestCase):
|
||||
'Test online source module'
|
||||
module = 'investment'
|
||||
|
||||
class SourceTestCase(object):
|
||||
""" test online source
|
||||
"""
|
||||
@with_transaction()
|
||||
def test_waitlist_source_request(self):
|
||||
""" create source, call server
|
||||
|
@ -59,7 +57,7 @@ class SourceTestCase(ModuleTestCase):
|
|||
|
||||
asset = self.prep_asset_item(
|
||||
company=company,
|
||||
product = product)
|
||||
product=product)
|
||||
|
||||
Asset.write(*[
|
||||
[asset],
|
||||
|
@ -68,9 +66,8 @@ class SourceTestCase(ModuleTestCase):
|
|||
}])
|
||||
|
||||
with Transaction().set_context({
|
||||
'qdate': date(2022, 10, 1), # saturday
|
||||
'qdatetime': datetime(2022, 10, 2, 10, 0, 0),
|
||||
}):
|
||||
'qdate': date(2022, 10, 1), # saturday
|
||||
'qdatetime': datetime(2022, 10, 2, 10, 0, 0)}):
|
||||
asset2, = Asset.browse([asset])
|
||||
self.assertEqual(asset2.wkn, '965515')
|
||||
self.assertEqual(asset2.isin, 'XC0009655157')
|
||||
|
@ -82,7 +79,6 @@ class SourceTestCase(ModuleTestCase):
|
|||
self.assertEqual(asset2.nextupdate, datetime(2022, 10, 3, 14, 0))
|
||||
self.assertEqual(len(asset.rates), 0)
|
||||
|
||||
|
||||
# fake server-response
|
||||
resp1 = Response()
|
||||
resp1._content = """<html><body>Response from finance-server
|
||||
|
@ -127,8 +123,8 @@ High 34,87 EUR
|
|||
OSource.write(*[
|
||||
[osource],
|
||||
{
|
||||
'rgxdate': 'Course Date (\\d+-\\d+-\\d+) Today',
|
||||
'rgxdatefmt': '%Y-%m-%d',
|
||||
'rgxdate': 'Course Date (\\d+-\\d+-\\d+) Today',
|
||||
'rgxdatefmt': '%Y-%m-%d',
|
||||
}])
|
||||
self.assertEqual(osource.get_regex_result(
|
||||
'The Course Date 2022-03-14 Today, High 13,43 EUR',
|
26
tests/test_module.py
Normal file
26
tests/test_module.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# This file is part of the investment-module from m-ds for 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
|
||||
from .asset import AssetTestCase
|
||||
from .rate import RateTestCase
|
||||
from .source import SourceTestCase
|
||||
from .wizard import WizardTestCase
|
||||
|
||||
|
||||
class InvestmentTestCase(
|
||||
WizardTestCase,
|
||||
SourceTestCase,
|
||||
RateTestCase,
|
||||
AssetTestCase,
|
||||
ModuleTestCase):
|
||||
'Test investment module'
|
||||
module = 'investment'
|
||||
|
||||
# end InvestmentTestCase
|
||||
|
||||
|
||||
del ModuleTestCase
|
|
@ -3,24 +3,21 @@
|
|||
# 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, with_transaction
|
||||
from trytond.tests.test_tryton import with_transaction
|
||||
from trytond.pool import Pool
|
||||
from trytond.modules.company.tests import create_company
|
||||
from trytond.transaction import Transaction
|
||||
from decimal import Decimal
|
||||
from datetime import date
|
||||
|
||||
|
||||
class WizardTestCase(ModuleTestCase):
|
||||
'Test wizard module'
|
||||
module = 'investment'
|
||||
|
||||
class WizardTestCase(object):
|
||||
""" test import wizard
|
||||
"""
|
||||
@with_transaction()
|
||||
def test_wiz_run_import(self):
|
||||
""" run import wizard
|
||||
"""
|
||||
pool = Pool()
|
||||
Asset = pool.get('investment.asset')
|
||||
ImportWiz = pool.get('investment.imp_wiz', type='wizard')
|
||||
|
||||
company = self.prep_asset_company()
|
||||
|
@ -28,15 +25,12 @@ class WizardTestCase(ModuleTestCase):
|
|||
name='Product 1',
|
||||
description='some asset')
|
||||
|
||||
asset = self.prep_asset_item(
|
||||
company=company,
|
||||
product = product)
|
||||
asset = self.prep_asset_item(company=company, product=product)
|
||||
self.assertEqual(len(asset.rates), 0)
|
||||
|
||||
with Transaction().set_context({
|
||||
'active_id': asset.id,
|
||||
'active_model': 'investment.asset',
|
||||
}):
|
||||
'active_id': asset.id,
|
||||
'active_model': 'investment.asset'}):
|
||||
(sess_id, start_state, end_state) = ImportWiz.create()
|
||||
w_obj = ImportWiz(sess_id)
|
||||
self.assertEqual(start_state, 'start')
|
||||
|
@ -61,7 +55,8 @@ class WizardTestCase(ModuleTestCase):
|
|||
'dec_divider': ',',
|
||||
'date_fmt': '%d.%m.%Y',
|
||||
'field_delimiter': ';',
|
||||
'file_': b'"date";"rate"\n"03.05.2022";"23,56"\n"05.05.2022";"24,22"\n"06.05.2022";"25,43"',
|
||||
'file_': b'"date";"rate"\n"03.05.2022";"23,56"\n' +
|
||||
b'"05.05.2022";"24,22"\n"06.05.2022";"25,43"',
|
||||
}}, 'importf')
|
||||
self.assertEqual(list(result.keys()), [])
|
||||
# finish wizard
|
Loading…
Add table
Add a link
Reference in a new issue