mirror of
https://github.com/bringout/oca-ocb-core.git
synced 2026-04-19 08:32:05 +02:00
Initial commit: Core packages
This commit is contained in:
commit
12c29a983b
9512 changed files with 8379910 additions and 0 deletions
31
odoo-bringout-oca-ocb-mail/mail/tests/test_uninstall.py
Normal file
31
odoo-bringout-oca-ocb-mail/mail/tests/test_uninstall.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo.tests import tagged, TransactionCase
|
||||
|
||||
|
||||
@tagged('-at_install', 'post_install')
|
||||
class TestMailUninstall(TransactionCase):
|
||||
def test_unlink_model(self):
|
||||
model = self.env['ir.model'].create({
|
||||
'name': 'Test Model',
|
||||
'model': 'x_test_model',
|
||||
'state': 'manual',
|
||||
'is_mail_thread': True,
|
||||
})
|
||||
activity_type = self.env['mail.activity.type'].create({
|
||||
'name': 'Test Activity Type',
|
||||
'res_model': model.model,
|
||||
})
|
||||
record = self.env[model.model].create({})
|
||||
|
||||
activity = self.env['mail.activity'].create({
|
||||
'activity_type_id': activity_type.id,
|
||||
'res_model_id': model.id,
|
||||
'res_id': record.id,
|
||||
})
|
||||
|
||||
model.unlink()
|
||||
self.assertFalse(model.exists())
|
||||
self.assertFalse(activity_type.exists())
|
||||
self.assertFalse(activity.exists())
|
||||
Loading…
Add table
Add a link
Reference in a new issue