Skip to content

Commit c30c985

Browse files
author
sonhd91
committed
[16.0][MIG] test_base_import_async: Migrate to version 16.0
1 parent a42e64f commit c30c985

File tree

8 files changed

+51
-26
lines changed

8 files changed

+51
-26
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ exclude: |
44
^base_export_async/|
55
^base_import_async/|
66
^queue_job_subscribe/|
7-
^test_base_import_async/|
87
# END NOT INSTALLABLE ADDONS
98
# Files and folders generated by bots, to avoid loops
109
^setup/|/static/description/index\.html$|

test_base_import_async/README.rst

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ Test suite for base_import_async
1414
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1515
:alt: License: AGPL-3
1616
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github
17-
:target: https://github.com/OCA/queue/tree/14.0/test_base_import_async
17+
:target: https://github.com/OCA/queue/tree/16.0/test_base_import_async
1818
:alt: OCA/queue
1919
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
20-
:target: https://translation.odoo-community.org/projects/queue-14-0/queue-14-0-test_base_import_async
20+
:target: https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-test_base_import_async
2121
:alt: Translate me on Weblate
22-
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
23-
:target: https://runbot.odoo-community.org/runbot/230/14.0
24-
:alt: Try me on Runbot
22+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
23+
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/queue&target_branch=16.0
24+
:alt: Try me on Runboat
2525

2626
|badge1| |badge2| |badge3| |badge4| |badge5|
2727

@@ -38,7 +38,7 @@ Bug Tracker
3838
Bugs are tracked on `GitHub Issues <https://github.com/OCA/queue/issues>`_.
3939
In case of trouble, please check there if your issue has already been reported.
4040
If you spotted it first, help us smashing it by providing a detailed and welcomed
41-
`feedback <https://github.com/OCA/queue/issues/new?body=module:%20test_base_import_async%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
41+
`feedback <https://github.com/OCA/queue/issues/new?body=module:%20test_base_import_async%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
4242

4343
Do not contact contributors directly about support or help with technical issues.
4444

@@ -56,6 +56,14 @@ Contributors
5656
* Stéphane Bidoul (ACSONE)
5757
* Dennis Sluijk (Onestein)
5858
* Guewen Baconnier (Camptocamp)
59+
* `Trobz <https://trobz.com>`_:
60+
61+
* Son Ho <[email protected]>
62+
63+
Other credits
64+
~~~~~~~~~~~~~
65+
66+
The migration of this module from 14.0 to 16.0 was financially supported by Camptocamp
5967

6068
Maintainers
6169
~~~~~~~~~~~
@@ -70,6 +78,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
7078
mission is to support the collaborative development of Odoo features and
7179
promote its widespread use.
7280

73-
This module is part of the `OCA/queue <https://github.com/OCA/queue/tree/14.0/test_base_import_async>`_ project on GitHub.
81+
This module is part of the `OCA/queue <https://github.com/OCA/queue/tree/16.0/test_base_import_async>`_ project on GitHub.
7482

7583
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

test_base_import_async/__manifest__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
{
66
"name": "Test suite for base_import_async",
7-
"version": "14.0.1.0.1",
7+
"version": "16.0.1.0.0",
88
"author": "ACSONE SA/NV, Odoo Community Association (OCA)",
99
"license": "AGPL-3",
1010
"website": "https://github.com/OCA/queue",
@@ -15,6 +15,6 @@
1515
""",
1616
"depends": ["base_import_async", "account"],
1717
"data": [],
18-
"installable": False,
18+
"installable": True,
1919
"development_status": "Production/Stable",
2020
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
* Stéphane Bidoul (ACSONE)
22
* Dennis Sluijk (Onestein)
33
* Guewen Baconnier (Camptocamp)
4+
* `Trobz <https://trobz.com>`_:
5+
6+
* Son Ho <[email protected]>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The migration of this module from 14.0 to 16.0 was financially supported by Camptocamp

test_base_import_async/static/description/index.html

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
44
<head>
55
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6-
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
6+
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
77
<title>Test suite for base_import_async</title>
88
<style type="text/css">
99

@@ -367,7 +367,7 @@ <h1 class="title">Test suite for base_import_async</h1>
367367
!! This file is generated by oca-gen-addon-readme !!
368368
!! changes will be overwritten. !!
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
370-
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/queue/tree/14.0/test_base_import_async"><img alt="OCA/queue" src="https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/queue-14-0/queue-14-0-test_base_import_async"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/230/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
370+
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/queue/tree/16.0/test_base_import_async"><img alt="OCA/queue" src="https://img.shields.io/badge/github-OCA%2Fqueue-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/queue-16-0/queue-16-0-test_base_import_async"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runboat.odoo-community.org/webui/builds.html?repo=OCA/queue&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
371371
<p>Test suite for base_import_async. Normally you don’t need to install this.</p>
372372
<p><strong>Table of contents</strong></p>
373373
<div class="contents local topic" id="contents">
@@ -376,7 +376,8 @@ <h1 class="title">Test suite for base_import_async</h1>
376376
<li><a class="reference internal" href="#credits" id="id2">Credits</a><ul>
377377
<li><a class="reference internal" href="#authors" id="id3">Authors</a></li>
378378
<li><a class="reference internal" href="#contributors" id="id4">Contributors</a></li>
379-
<li><a class="reference internal" href="#maintainers" id="id5">Maintainers</a></li>
379+
<li><a class="reference internal" href="#other-credits" id="id5">Other credits</a></li>
380+
<li><a class="reference internal" href="#maintainers" id="id6">Maintainers</a></li>
380381
</ul>
381382
</li>
382383
</ul>
@@ -386,7 +387,7 @@ <h1><a class="toc-backref" href="#id1">Bug Tracker</a></h1>
386387
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/queue/issues">GitHub Issues</a>.
387388
In case of trouble, please check there if your issue has already been reported.
388389
If you spotted it first, help us smashing it by providing a detailed and welcomed
389-
<a class="reference external" href="https://github.com/OCA/queue/issues/new?body=module:%20test_base_import_async%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
390+
<a class="reference external" href="https://github.com/OCA/queue/issues/new?body=module:%20test_base_import_async%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
390391
<p>Do not contact contributors directly about support or help with technical issues.</p>
391392
</div>
392393
<div class="section" id="credits">
@@ -399,20 +400,34 @@ <h2><a class="toc-backref" href="#id3">Authors</a></h2>
399400
</div>
400401
<div class="section" id="contributors">
401402
<h2><a class="toc-backref" href="#id4">Contributors</a></h2>
403+
<ul>
404+
<li><p class="first">Stéphane Bidoul (ACSONE)</p>
405+
</li>
406+
<li><p class="first">Dennis Sluijk (Onestein)</p>
407+
</li>
408+
<li><p class="first">Guewen Baconnier (Camptocamp)</p>
409+
</li>
410+
<li><p class="first"><a class="reference external" href="https://trobz.com">Trobz</a>:</p>
411+
<blockquote>
402412
<ul class="simple">
403-
<li>Stéphane Bidoul (ACSONE)</li>
404-
<li>Dennis Sluijk (Onestein)</li>
405-
<li>Guewen Baconnier (Camptocamp)</li>
413+
<li>Son Ho &lt;<a class="reference external" href="mailto:sonhd&#64;trobz.com">sonhd&#64;trobz.com</a>&gt;</li>
406414
</ul>
415+
</blockquote>
416+
</li>
417+
</ul>
418+
</div>
419+
<div class="section" id="other-credits">
420+
<h2><a class="toc-backref" href="#id5">Other credits</a></h2>
421+
<p>The migration of this module from 14.0 to 16.0 was financially supported by Camptocamp</p>
407422
</div>
408423
<div class="section" id="maintainers">
409-
<h2><a class="toc-backref" href="#id5">Maintainers</a></h2>
424+
<h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
410425
<p>This module is maintained by the OCA.</p>
411426
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
412427
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
413428
mission is to support the collaborative development of Odoo features and
414429
promote its widespread use.</p>
415-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/queue/tree/14.0/test_base_import_async">OCA/queue</a> project on GitHub.</p>
430+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/queue/tree/16.0/test_base_import_async">OCA/queue</a> project on GitHub.</p>
416431
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
417432
</div>
418433
</div>

test_base_import_async/tests/account.move.csv

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
date,journal_id/id,name,ref,line_ids/account_id/id,line_ids/name,line_ids/debit,line_ids/credit,line_ids/partner_id/id
21
2014-11-08,test_base_import_async.testjournal_xmlid,TEST-1,SAJ/2014/005,test_base_import_async.a_recv_xmlid,/,525,,base.res_partner_3
32
,,,,test_base_import_async.a_sale_xmlid,Ergonomic Mouse,,75,base.res_partner_3
43
,,,,test_base_import_async.a_sale_xmlid,TypeMatrix Dvorak Keyboard,,450,base.res_partner_3

test_base_import_async/tests/test_base_import_async.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from odoo.addons.queue_job.job import Job
1717

1818

19-
class TestBaseImportAsync(common.SavepointCase):
19+
class TestBaseImportAsync(common.TransactionCase):
2020

2121
FIELDS = [
2222
"date",
@@ -79,7 +79,7 @@ def _do_import(self, file_name, use_queue, chunk_size=None):
7979
options = dict(self.OPTIONS)
8080
options[OPT_USE_QUEUE] = use_queue
8181
options[OPT_CHUNK_SIZE] = chunk_size
82-
return importer.do(self.FIELDS, self.FIELDS, options)
82+
return importer.execute_import(self.FIELDS, self.FIELDS, options)
8383

8484
def _check_import_result(self):
8585
move_count = self.move_obj.search_count(
@@ -88,13 +88,13 @@ def _check_import_result(self):
8888
self.assertEqual(move_count, 3)
8989

9090
def test_normal_import(self):
91-
""" Test the standard import still works. """
91+
"""Test the standard import still works."""
9292
res = self._do_import("account.move.csv", use_queue=False)
9393
self.assertFalse(res["messages"], repr(res))
9494
self._check_import_result()
9595

9696
def test_async_import(self):
97-
""" Basic asynchronous import test with default large chunk size. """
97+
"""Basic asynchronous import test with default large chunk size."""
9898
res = self._do_import("account.move.csv", use_queue=True)
9999
self.assertFalse(res, repr(res))
100100
# no moves should be created yet
@@ -123,7 +123,7 @@ def test_async_import(self):
123123
self._check_import_result()
124124

125125
def test_async_import_small_misaligned_chunks(self):
126-
""" Chunk size larger than record. """
126+
"""Chunk size larger than record."""
127127
res = self._do_import("account.move.csv", use_queue=True, chunk_size=4)
128128
self.assertFalse(res, repr(res))
129129
# but we must have one job to split the file
@@ -148,7 +148,7 @@ def test_async_import_small_misaligned_chunks(self):
148148
self._check_import_result()
149149

150150
def test_async_import_smaller_misaligned_chunks(self):
151-
""" Chunk size smaller than record. """
151+
"""Chunk size smaller than record."""
152152
res = self._do_import("account.move.csv", use_queue=True, chunk_size=2)
153153
self.assertFalse(res, repr(res))
154154
# but we must have one job to split the file

0 commit comments

Comments
 (0)