Skip to content
Permalink
Browse files

🛡 website_multi_company_demo: added test cases with website_price_dif…

…ference
  • Loading branch information...
em230418 committed Jul 26, 2019
1 parent ad43299 commit 239c060027499f6cb2a4232e4f2a5dd691966ee4
@@ -1 +1,2 @@
from . import test_domain_updating
from . import test_website_multi_company
@@ -0,0 +1,29 @@
# -*- coding: utf-8 -*-
from odoo.tests.common import SingleTransactionCase, get_db_name, at_install, post_install
from ..models.res_users import WEBSITE_REFS
from odoo.api import Environment

db_name = get_db_name()


@at_install(False)
@post_install(True)
class TestWebsiteMultiCompany(SingleTransactionCase):

def _test_website_price_difference_is_accessible(self, env):
website = env.ref(WEBSITE_REFS[0])
products = env['product.template'].search(
[('company_id', '=', website.company_id.id)] +
website.sale_product_domain()
)
product = products[0]
product.website_price_difference # make sure, it does not throw exception

def test_website_price_difference_is_accessible_for_demo_user(self):
uid = self.registry['res.users'].authenticate(db_name, 'demo', 'demo', {})
with self.cursor() as cr:
env = Environment(cr, uid, {})
self._test_website_price_difference_is_accessible(env)

def test_website_price_difference_is_accessible_for_public_user(self, env=None):
self._test_website_price_difference_is_accessible(self.env(user=self.browse_ref('base.public_user')))

0 comments on commit 239c060

Please sign in to comment.
You can’t perform that action at this time.