Files
odoo_source/addons/event/tests/common.py
T
Mahendra barad ad48bf6d7d [IMP] [ADD] event: mail schedulign system.
This commit adds a way to configure scheduled emails on events. It replaces
existing automatic emails at confirmation and subscription. It proposes to
configure some schedulers, based on subscription or event, using a template
and a configurable timedelta.

A cron is added that regularly checks for event mailing schedulers to execute
and launch them. The granularity of send emails is therefore limited to the
granularity of the cron, aka 1 hour.

[TEST] Added tests for this feature.

Also cleaned a bit event, country_id is now a pure related instead
of a computed field trying to be a related. Also removed default templates
on event category. Configuration in the event itself should be easy
enough for most use cases.
2014-10-17 16:48:29 +02:00

40 lines
1.5 KiB
Python

# -*- coding: utf-8 -*-
from dateutil.relativedelta import relativedelta
from openerp import fields
from openerp.tests import common
class TestEventCommon(common.TransactionCase):
def setUp(self):
super(TestEventCommon, self).setUp()
# Usefull models
self.Users = self.env['res.users']
self.Event = self.env['event.event']
self.Registration = self.env['event.registration']
self.EventMail = self.env['event.mail']
# User groups
self.group_employee_id = self.env['ir.model.data'].xmlid_to_res_id('base.group_user')
self.group_event_user_id = self.env['ir.model.data'].xmlid_to_res_id('event.group_event_user')
self.group_event_manager_id = self.env['ir.model.data'].xmlid_to_res_id('event.group_event_manager')
# Test users to use through the various tests
self.user_eventuser = self.Users.with_context({'no_reset_password': True}).create({
'name': 'Armande EventUser',
'login': 'Armande',
'alias_name': 'armande',
'email': 'armande.eventuser@example.com',
'groups_id': [(6, 0, [self.group_employee_id, self.group_event_user_id])]
})
self.user_eventmanager = self.Users.with_context({'no_reset_password': True}).create({
'name': 'Bastien EventManager',
'login': 'bastien',
'alias_name': 'bastien',
'email': 'bastien.eventmanager@example.com',
'groups_id': [(6, 0, [self.group_employee_id, self.group_event_manager_id])]
})