Skip to content

Commit

Permalink
Merge pull request #1553 from VoicuStefan2001/16.0-upd-deltatech_down…
Browse files Browse the repository at this point in the history
…load

[16.0][UPD] deltatech_download tests
  • Loading branch information
VoicuStefan2001 authored Jul 15, 2024
2 parents 53a30c0 + 35b2e87 commit 3c7f431
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ addon | version | maintainers | summary | price
[deltatech_data_sheet_website](deltatech_data_sheet_website/) | 16.0.1.0.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Data Sheet | Free
[deltatech_dc](deltatech_dc/) | 16.0.1.0.4 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Print Declaration of Conformity | Free
[deltatech_delivery_status](deltatech_delivery_status/) | 16.0.2.0.4 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Carrier status on picking | Free
[deltatech_download](deltatech_download/) | 16.0.0.1.1 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Generare fisier | Free
[deltatech_download](deltatech_download/) | 16.0.0.1.2 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Generare fisier | Free
[deltatech_dropshipping](deltatech_dropshipping/) | 16.0.1.0.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Delivery address in picking | Free
[deltatech_dummy_queue_job](deltatech_dummy_queue_job/) | 16.0.1.0.0 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Dummy Queue Job | Free
[deltatech_expenses](deltatech_expenses/) | 16.0.1.0.3 | [![dhongu](https://github.com/dhongu.png?size=30px)](https://github.com/dhongu) | Expenses Deduction & Disposition of Cashing | Free
Expand Down
2 changes: 1 addition & 1 deletion deltatech_download/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Download File
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:6ab1bfbc313b04df235117638f6409d2bdd72c07bfe523b013c039d1251cfda6
!! source digest: sha256:8ca010af59a5fa47b8a6b7b5256954267a37f8e211ec1216847169765c95849d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
Expand Down
2 changes: 1 addition & 1 deletion deltatech_download/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{
"name": "Download File",
"version": "16.0.0.1.1",
"version": "16.0.0.1.2",
"author": "Terrabit,Dorin Hongu",
"summary": "Generare fisier",
"website": "https://www.terrabit.ro",
Expand Down
2 changes: 1 addition & 1 deletion deltatech_download/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h1 class="title">Download File</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:6ab1bfbc313b04df235117638f6409d2bdd72c07bfe523b013c039d1251cfda6
!! source digest: sha256:8ca010af59a5fa47b8a6b7b5256954267a37f8e211ec1216847169765c95849d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external image-reference" href="https://www.odoo.com/documentation/master/legal/licenses.html"><img alt="License: OPL-1" src="https://img.shields.io/badge/licence-OPL--1-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/dhongu/deltatech/tree/16.0/deltatech_download"><img alt="dhongu/deltatech" src="https://img.shields.io/badge/github-dhongu%2Fdeltatech-lightgray.png?logo=github" /></a></p>
<dl class="docutils">
Expand Down
1 change: 1 addition & 0 deletions deltatech_download/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# © 2008-2021 Deltatech
# Dorin Hongu <dhongu(@)gmail(.)com
# See README.rst file on addons root folder for license details
from . import test_download
27 changes: 27 additions & 0 deletions deltatech_download/tests/test_download.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import base64

from odoo.tests.common import TransactionCase


class TestWizardDownloadFile(TransactionCase):

def setUp(self):
super().setUp()
self.wizard = self.env["wizard.download.file"].create(
{
"file_name": "test_file.txt",
"data_file": base64.b64encode(b"Test file content"),
}
)

def test_do_download_file(self):
action = self.wizard.do_download_file()

expected_url = (
"/web/content?model=wizard.download.file&download=True&field=data_file&id=%s&filename=test_file.txt"
% self.wizard.id
)

self.assertEqual(action["type"], "ir.actions.act_url")
self.assertEqual(action["url"], expected_url)
self.assertEqual(action["target"], "new")

0 comments on commit 3c7f431

Please sign in to comment.