[IMP] document_url: black, isort

This commit is contained in:
Manuel Calero
2020-03-11 10:28:27 +01:00
committed by Bhavesh Heliconia
parent 0211bf41c2
commit 9260841adf
6 changed files with 47 additions and 61 deletions

View File

@@ -6,25 +6,24 @@ from odoo.tests import common
class TestDocumentUrl(common.TransactionCase):
def setUp(self):
super(TestDocumentUrl, self).setUp()
wizard_add_url = self.env['ir.attachment.add_url']
wizard_add_url = self.env["ir.attachment.add_url"]
ctx = {
'active_model': 'res.users',
'active_id': self.env.ref('base.user_demo').id,
'active_ids': [self.env.ref('base.user_demo').id]
"active_model": "res.users",
"active_id": self.env.ref("base.user_demo").id,
"active_ids": [self.env.ref("base.user_demo").id],
}
self.wizard_add_url = wizard_add_url.with_context(ctx).create({
'name': 'Demo User (Website)',
'url': 'http://www.odoodemouser.com'
})
self.wizard_add_url = wizard_add_url.with_context(ctx).create(
{"name": "Demo User (Website)", "url": "http://www.odoodemouser.com"}
)
def test_add_url_attachment(self):
self.wizard_add_url.action_add_url()
domain = [
('type', '=', 'url'),
('name', '=', 'Demo User (Website)'),
('url', '=', 'http://www.odoodemouser.com'),
('res_model', '=', 'res.users'),
('res_id', '=', self.env.ref('base.user_demo').id)
("type", "=", "url"),
("name", "=", "Demo User (Website)"),
("url", "=", "http://www.odoodemouser.com"),
("res_model", "=", "res.users"),
("res_id", "=", self.env.ref("base.user_demo").id),
]
attachment_added_count = self.env['ir.attachment'].search_count(domain)
attachment_added_count = self.env["ir.attachment"].search_count(domain)
self.assertEqual(attachment_added_count, 1)