Files
odoo_source/addons/membership/tests/common.py
T
Laurent Smet 15a45be08f [IMP] membership: Remove dependency to AccountTestCommon
l10n runbot builds are all failing when running at least one test depending of AccountTestCommon because it:
- doesn't create a sandboxed testing environnement to manage the multi-currency, multi-company, the default company's currency, the exchange rates...
- doesn't setup a testing user then all tests are done using the superuser.
- doesn't provide a fully setup chart of accounts: exchange difference journal is not set, accounts have bad types, etc...
- is run sometimes at-install.

--task: 2296213
2020-07-16 07:26:12 +00:00

33 lines
1.0 KiB
Python

# -*- coding: utf-8 -*-
import datetime
from dateutil.relativedelta import relativedelta
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
class TestMembershipCommon(AccountTestInvoicingCommon):
@classmethod
def setUpClass(cls, chart_template_ref=None):
super().setUpClass(chart_template_ref=chart_template_ref)
# Test memberships
cls.membership_1 = cls.env['product.product'].create({
'membership': True,
'membership_date_from': datetime.date.today() + relativedelta(days=-2),
'membership_date_to': datetime.date.today() + relativedelta(months=1),
'name': 'Basic Limited',
'type': 'service',
'list_price': 100.00,
})
# Test people
cls.partner_1 = cls.env['res.partner'].create({
'name': 'Ignasse Reblochon',
})
cls.partner_2 = cls.env['res.partner'].create({
'name': 'Martine Poulichette',
'free_member': True,
})