| 1 |
|
| 2 |
|
| 3 |
from odoo.fields import Command |
| 4 |
from odoo.tests import HttpCase, tagged |
| 5 |
|
| 6 |
|
| 7 |
@tagged('-at_install', 'post_install') |
| 8 |
class TestWishlistProcess(HttpCase): |
| 9 |
|
| 10 |
def test_01_wishlist_tour(self): |
| 11 |
self.env['product.template'].search([]).write({'website_published': False}) |
| 12 |
|
| 13 |
attributes = self.env['product.attribute'].create([ |
| 14 |
{ |
| 15 |
'name': 'Legs', |
| 16 |
'sequence': 10, |
| 17 |
'value_ids': [ |
| 18 |
Command.create({ |
| 19 |
'name': 'Steel', |
| 20 |
'sequence': 1, |
| 21 |
}), |
| 22 |
Command.create({ |
| 23 |
'name': 'Aluminium', |
| 24 |
'sequence': 2, |
| 25 |
}), |
| 26 |
], |
| 27 |
}, { |
| 28 |
'name': 'Color', |
| 29 |
'sequence': 20, |
| 30 |
'value_ids': [ |
| 31 |
Command.create({ |
| 32 |
'name': 'White', |
| 33 |
'sequence': 1, |
| 34 |
}), |
| 35 |
Command.create({ |
| 36 |
'name': 'Black', |
| 37 |
'sequence': 2, |
| 38 |
}), |
| 39 |
], |
| 40 |
}, |
| 41 |
]) |
| 42 |
|
| 43 |
|
| 44 |
self.env['product.template'].create({ |
| 45 |
'name': 'Customizable Desk (TEST)', |
| 46 |
'standard_price': 500.0, |
| 47 |
'list_price': 750.0, |
| 48 |
'website_published': True, |
| 49 |
'attribute_line_ids': [ |
| 50 |
Command.create({ |
| 51 |
'attribute_id': attribute.id, |
| 52 |
'value_ids': [Command.set(attribute.value_ids.ids)] |
| 53 |
}) for attribute in attributes |
| 54 |
], |
| 55 |
}) |
| 56 |
|
| 57 |
self.env.ref('base.user_admin').name = 'Mitchell Admin' |
| 58 |
|
| 59 |
self.start_tour("/", 'shop_wishlist', timeout=120) |