Commit 2ccd1f2f authored by Jérome Perrin's avatar Jérome Perrin

pdm_ui_test: fix pylint warnings and enable coding style test

parent c3516749
......@@ -15,8 +15,6 @@ destination_node_id = "erp5_pdm_ui_test_destination_node"
resource_id = "erp5_pdm_ui_test_product"
business_process_id = 'erp5_default_business_process'
quantity = 1
business_process_module = portal.getDefaultModule("Business Process")
business_process = getattr(business_process_module, business_process_id, None)
if business_process is None:
......@@ -40,7 +38,7 @@ if state in ['planned', 'ordered']:
specialise_value=business_process,
start_date=DateTime(),
)
order_line = order.newContent(
order.newContent(
portal_type=order_line_portal_type,
resource='product_module/%s' % resource_id,
quantity=1,
......@@ -63,7 +61,7 @@ else:
specialise_value=business_process,
start_date=DateTime(),
)
delivery_line = delivery.newContent(
delivery.newContent(
portal_type=delivery_line_portal_type,
resource='product_module/%s' % resource_id,
quantity=1,
......@@ -87,8 +85,6 @@ else:
break
if delivery.getSimulationState() != state:
raise ImplementationError, 'Delivery state is %s and not %s' % (delivery.getSimulationState(), state)
raise NotImplementedError('Delivery state is %s and not %s' % (delivery.getSimulationState(), state))
return "Delivery Created."
# vim: syntax=python
......@@ -2,8 +2,6 @@ portal = context.getPortalObject()
resource_portal_type = "Product"
node_portal_type = "Organisation"
site_portal_type = "Category"
resource_id = "erp5_pdm_ui_test_product"
source_node_id = "erp5_pdm_ui_test_source_node"
......
portal = context.getPortalObject()
self = context
resource_portal_type = "Product"
node_portal_type = "Organisation"
......@@ -42,7 +41,7 @@ resource.validate()
base_category = portal.restrictedTraverse('portal_categories/site')
for site_id, site_title in ((source_site_id, source_site_title),
(destination_site_id, destination_site_title)):
site = base_category.newContent(
base_category.newContent(
portal_type=site_portal_type,
id=site_id,
title=site_title
......@@ -52,7 +51,7 @@ for site_id, site_title in ((source_site_id, source_site_title),
for node_id, node_title, site_url in ((source_node_id, source_node_title, source_site_id),
(destination_node_id, destination_node_title, destination_site_id)):
module = portal.getDefaultModule(node_portal_type)
node = module.newContent(
module.newContent(
portal_type=node_portal_type,
id=node_id,
title=node_title,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment