[FIX]document_url_google_drive: fix in tests move name parameters

This commit is contained in:
Demchuk Mykola 2023-11-06 22:18:03 +02:00
parent 62f73d21d1
commit c24bdd0159
3 changed files with 117 additions and 30 deletions

View File

@ -1,35 +1,126 @@
**This file is going to be generated by oca-gen-addon-readme.** ===========================
Google Drive URL attachment
===========================
*Manual changes will be overwritten.* ..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b1892b278b57e83eeb2a47df1e2d7d49a5a9c517f3e05ce1ef6984d2bdfb2b75
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Please provide content in the ``readme`` directory: .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fknowledge-lightgray.png?logo=github
:target: https://github.com/OCA/knowledge/tree/16.0/document_url_google_drive
:alt: OCA/knowledge
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/knowledge-16-0/knowledge-16-0-document_url_google_drive
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/knowledge&target_branch=16.0
:alt: Try me on Runboat
* **DESCRIPTION.rst** (required) |badge1| |badge2| |badge3| |badge4| |badge5|
* INSTALL.rst (optional)
* CONFIGURE.rst (optional)
* **USAGE.rst** (optional, highly recommended)
* DEVELOP.rst (optional)
* ROADMAP.rst (optional)
* HISTORY.rst (optional, recommended)
* **CONTRIBUTORS.rst** (optional, highly recommended)
* CREDITS.rst (optional)
Content of this README will also be drawn from the addon manifest, This module extends the functionality of the document_url module and
from keys such as name, authors, maintainers, development_status, allows you to attach a link to a file from your Google Drive
and license.
A good, one sentence summary in the manifest is also highly recommended. **Table of contents**
.. contents::
:local:
Automatic changelog generation Configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ =============
`HISTORY.rst` can be auto generated using `towncrier <https://pypi.org/project/towncrier>`_. To configure this module, you need to:
Just put towncrier compatible changelog fragments into `readme/newsfragments` - Go to Settings -> General Settings and scroll down to the
and the changelog file will be automatically generated and updated when a new fragment is added. Integrations section.
Please refer to `towncrier` documentation to know more. - Enable "Google API", save.
NOTE: the changelog will be automatically generated when using `/ocabot merge $option`. - field "Google Client ID" - enter the client ID from the Google API
If you need to run it manually, refer to `OCA/maintainer-tools README <https://github.com/OCA/maintainer-tools>`_. console.
- field "Google API key" - enter the API key from the Google API
console.
- field "Google App ID" - enter the ID of the Google application.
The default value is ``odoo``.
- Next, open your user profile and set up personal access credentials
on the "Google API" tab.
- field "Google Scope" - enter the scope for the Google API. The
default value is
``https://www.googleapis.com/auth/drive.readonly``.
- field "Google Access Token" - your token will be displayed here.
It is necessary to edit it.
- field "Google Mime Types" - enter the file formats to be filtered
when selecting. Example:
``application/pdf, image/jpeg, image/png``. By default, all files
are selected
- You will be asked to authenticate when you add a link for the first
time.
Usage
=====
To use this module, you need to:
#. Open the form view of an object (Example: Customer Invoice
INV/2019/0007). #. Go to the chatter and click on the attached icon. #.
Click **Add GDrive link**. #. Fill the wizard fields and click on Add
button. #. In the open window, select the files you need and press the
select button. #. You will see a new **URL attachment** in the set of
attachments related to the object. #. In order to log in under another
google user, click on the logout icon located after **Add GDrive link**
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/knowledge/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/knowledge/issues/new?body=module:%20document_url_google_drive%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
-------
* Cetmix
Maintainers
-----------
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
.. |maintainer-CetmixGitDrone| image:: https://github.com/CetmixGitDrone.png?size=40px
:target: https://github.com/CetmixGitDrone
:alt: CetmixGitDrone
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-CetmixGitDrone|
This module is part of the `OCA/knowledge <https://github.com/OCA/knowledge/tree/16.0/document_url_google_drive>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -33,9 +33,7 @@ class TestDocumentUrl(common.TransactionCase):
self.assertEqual(attachment.mimetype, "application/link") self.assertEqual(attachment.mimetype, "application/link")
def test_get_google_picker_params_is_active(self): def test_get_google_picker_params_is_active(self):
self.config_settings.set_param( self.config_settings.set_param("is_active_google_api", True)
"document_url_google_drive.is_active_google_api", True
)
user = self.users.with_context(no_reset_password=True).create( user = self.users.with_context(no_reset_password=True).create(
{ {
"name": "Test User", "name": "Test User",
@ -62,9 +60,7 @@ class TestDocumentUrl(common.TransactionCase):
) )
def test_get_google_picker_params_not_is_active(self): def test_get_google_picker_params_not_is_active(self):
self.config_settings.set_param( self.config_settings.set_param("is_active_google_api", False)
"document_url_google_drive.is_active_google_api", False
)
user = self.users.with_context(no_reset_password=True).create( user = self.users.with_context(no_reset_password=True).create(
{ {
"name": "Test User", "name": "Test User",

BIN
pandoc-3.1.9-1-amd64.deb Normal file

Binary file not shown.