common.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # -*- coding: utf-8 -*-
  2. # Part of Odoo. See LICENSE file for full copyright and licensing details.
  3. from datetime import datetime, timedelta
  4. from odoo import fields
  5. from odoo.addons.event.tests.common import EventCase
  6. from odoo.addons.sales_team.tests.common import TestSalesCommon
  7. class TestEventSaleCommon(EventCase, TestSalesCommon):
  8. @classmethod
  9. def setUpClass(cls):
  10. super(TestEventSaleCommon, cls).setUpClass()
  11. cls.event_product = cls.env['product.product'].create({
  12. 'name': 'Test Registration Product',
  13. 'description_sale': 'Mighty Description',
  14. 'list_price': 10,
  15. 'standard_price': 30.0,
  16. 'detailed_type': 'event',
  17. })
  18. cls.event_type_tickets = cls.env['event.type'].create({
  19. 'name': 'Update Type',
  20. 'auto_confirm': True,
  21. 'has_seats_limitation': True,
  22. 'seats_max': 30,
  23. 'default_timezone': 'Europe/Paris',
  24. 'event_type_ticket_ids': [
  25. (0, 0, {'name': 'First Ticket',
  26. 'product_id': cls.event_product.id,
  27. 'seats_max': 5,
  28. })
  29. ],
  30. 'event_type_mail_ids': [],
  31. })
  32. cls.event_0 = cls.env['event.event'].create({
  33. 'name': 'TestEvent',
  34. 'auto_confirm': True,
  35. 'date_begin': fields.Datetime.to_string(datetime.today() + timedelta(days=1)),
  36. 'date_end': fields.Datetime.to_string(datetime.today() + timedelta(days=15)),
  37. 'date_tz': 'Europe/Brussels',
  38. })