Skip to content

Commit

Permalink
[FIX] website_sale_checkout_skip_payment: Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlosRoca13 authored and pilarvargas-tecnativa committed Oct 22, 2024
1 parent bd48517 commit 1013cf0
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 44 deletions.
19 changes: 11 additions & 8 deletions website_sale_checkout_skip_payment/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ Website Sale Checkout Skip Payment
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fe--commerce-lightgray.png?logo=github
:target: https://github.com/OCA/e-commerce/tree/14.0/website_sale_checkout_skip_payment
:target: https://github.com/OCA/e-commerce/tree/15.0/website_sale_checkout_skip_payment
:alt: OCA/e-commerce
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/e-commerce-14-0/e-commerce-14-0-website_sale_checkout_skip_payment
:target: https://translation.odoo-community.org/projects/e-commerce-15-0/e-commerce-15-0-website_sale_checkout_skip_payment
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/113/14.0
:target: https://runbot.odoo-community.org/runbot/113/15.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|
Expand Down Expand Up @@ -56,7 +56,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/e-commerce/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/e-commerce/issues/new?body=module:%20website_sale_checkout_skip_payment%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/e-commerce/issues/new?body=module:%20website_sale_checkout_skip_payment%0Aversion:%2015.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.

Expand All @@ -71,10 +71,13 @@ Authors
Contributors
~~~~~~~~~~~~

* Sergio Teruel <sergio.teruel@tecnativa.com>
* David Vidal <david.vidal@tecnativa.com>
* `Tecnativa <https://www.tecnativa.com>`_

* Sergio Teruel
* David Vidal
* Alexandre Díaz
* Carlos Roca
* Martin Wilderoth <martin.wilderoth@linserv.se>
* Alexandre Díaz <alexandre.diaz@tecnativa.com>

Maintainers
~~~~~~~~~~~
Expand All @@ -89,6 +92,6 @@ 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.

This module is part of the `OCA/e-commerce <https://github.com/OCA/e-commerce/tree/14.0/website_sale_checkout_skip_payment>`_ project on GitHub.
This module is part of the `OCA/e-commerce <https://github.com/OCA/e-commerce/tree/15.0/website_sale_checkout_skip_payment>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
Expand Down Expand Up @@ -64,27 +64,6 @@ msgstr ""
msgid "Contact"
msgstr ""

#. module: website_sale_checkout_skip_payment
#: model:ir.model.fields,field_description:website_sale_checkout_skip_payment.field_res_config_settings__display_name
#: model:ir.model.fields,field_description:website_sale_checkout_skip_payment.field_res_partner__display_name
#: model:ir.model.fields,field_description:website_sale_checkout_skip_payment.field_website__display_name
msgid "Display Name"
msgstr ""

#. module: website_sale_checkout_skip_payment
#: model:ir.model.fields,field_description:website_sale_checkout_skip_payment.field_res_config_settings__id
#: model:ir.model.fields,field_description:website_sale_checkout_skip_payment.field_res_partner__id
#: model:ir.model.fields,field_description:website_sale_checkout_skip_payment.field_website__id
msgid "ID"
msgstr ""

#. module: website_sale_checkout_skip_payment
#: model:ir.model.fields,field_description:website_sale_checkout_skip_payment.field_res_config_settings____last_update
#: model:ir.model.fields,field_description:website_sale_checkout_skip_payment.field_res_partner____last_update
#: model:ir.model.fields,field_description:website_sale_checkout_skip_payment.field_website____last_update
msgid "Last Modified on"
msgstr ""

#. module: website_sale_checkout_skip_payment
#: model_terms:ir.ui.view,arch_db:website_sale_checkout_skip_payment.res_config_settings_view_form
msgid "Message shown to the user when the purchase is finished"
Expand Down
9 changes: 6 additions & 3 deletions website_sale_checkout_skip_payment/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
* Sergio Teruel <sergio.teruel@tecnativa.com>
* David Vidal <david.vidal@tecnativa.com>
* `Tecnativa <https://www.tecnativa.com>`_

* Sergio Teruel
* David Vidal
* Alexandre Díaz
* Carlos Roca
* Martin Wilderoth <martin.wilderoth@linserv.se>
* Alexandre Díaz <alexandre.diaz@tecnativa.com>
16 changes: 10 additions & 6 deletions website_sale_checkout_skip_payment/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Website Sale Checkout Skip Payment</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/e-commerce/tree/14.0/website_sale_checkout_skip_payment"><img alt="OCA/e-commerce" src="https://img.shields.io/badge/github-OCA%2Fe--commerce-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/e-commerce-14-0/e-commerce-14-0-website_sale_checkout_skip_payment"><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/113/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/e-commerce/tree/15.0/website_sale_checkout_skip_payment"><img alt="OCA/e-commerce" src="https://img.shields.io/badge/github-OCA%2Fe--commerce-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/e-commerce-15-0/e-commerce-15-0-website_sale_checkout_skip_payment"><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/113/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module allows to logged users to checkout with no payment step. At the
end of the checkout proccess the quotation is sent to the user email address
and set to <em>Qoutation Sent</em> state.</p>
Expand Down Expand Up @@ -406,7 +406,7 @@ <h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/e-commerce/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/e-commerce/issues/new?body=module:%20website_sale_checkout_skip_payment%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/e-commerce/issues/new?body=module:%20website_sale_checkout_skip_payment%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -420,10 +420,14 @@ <h2><a class="toc-backref" href="#id5">Authors</a></h2>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id6">Contributors</a></h2>
<ul class="simple">
<li>Sergio Teruel &lt;<a class="reference external" href="mailto:sergio.teruel&#64;tecnativa.com">sergio.teruel&#64;tecnativa.com</a>&gt;</li>
<li>David Vidal &lt;<a class="reference external" href="mailto:david.vidal&#64;tecnativa.com">david.vidal&#64;tecnativa.com</a>&gt;</li>
<li><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a><ul>
<li>Sergio Teruel</li>
<li>David Vidal</li>
<li>Alexandre Díaz</li>
<li>Carlos Roca</li>
</ul>
</li>
<li>Martin Wilderoth &lt;<a class="reference external" href="mailto:martin.wilderoth&#64;linserv.se">martin.wilderoth&#64;linserv.se</a>&gt;</li>
<li>Alexandre Díaz &lt;<a class="reference external" href="mailto:alexandre.diaz&#64;tecnativa.com">alexandre.diaz&#64;tecnativa.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
Expand All @@ -433,7 +437,7 @@ <h2><a class="toc-backref" href="#id7">Maintainers</a></h2>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/e-commerce/tree/14.0/website_sale_checkout_skip_payment">OCA/e-commerce</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/e-commerce/tree/15.0/website_sale_checkout_skip_payment">OCA/e-commerce</a> project on GitHub.</p>
<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>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ odoo.define("website_sale_checkout_skip_payment.tour", function (require) {
trigger: "a:contains('Customizable Desk')",
},
{
trigger: "a:contains('Add to Cart')",
trigger: "a#add_to_cart",
},
{
trigger: "a[href='/shop/cart']",
extra_trigger: "sup.my_cart_quantity:contains('1')",
},
{
trigger: ".btn-primary:contains('Confirm')",
Expand All @@ -23,7 +27,7 @@ odoo.define("website_sale_checkout_skip_payment.tour", function (require) {
},
{
trigger: "a[href='/shop']",
extra_trigger: "h2:contains('Thank you for your order')",
extra_trigger: "strong:contains('Payment Information:')",
},
];
tour.register(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Copyright 2018 Tecnativa - Sergio Teruel
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
import mock
from unittest.mock import Mock, patch

from odoo.tests.common import HttpCase

Expand All @@ -16,8 +16,9 @@ def setUp(self):

def test_checkout_skip_payment(self):
website = self.env.ref("website.website2")
with mock.patch(
"odoo.addons.website_sale_checkout_skip_payment.models.website.request"
with patch(
"odoo.addons.website_sale_checkout_skip_payment.models.website.request",
new=Mock(),
) as request:
request.session.uid = False
self.assertFalse(website.checkout_skip_payment)
Expand Down

0 comments on commit 1013cf0

Please sign in to comment.