Commit 351776a8 authored by Jérome Perrin's avatar Jérome Perrin

pdm_ui_test: fix pylint warnings and enable coding style test

parent 79b4a6a2
...@@ -15,8 +15,6 @@ destination_node_id = "erp5_pdm_ui_test_destination_node" ...@@ -15,8 +15,6 @@ destination_node_id = "erp5_pdm_ui_test_destination_node"
resource_id = "erp5_pdm_ui_test_product" resource_id = "erp5_pdm_ui_test_product"
business_process_id = 'erp5_default_business_process' business_process_id = 'erp5_default_business_process'
quantity = 1
business_process_module = portal.getDefaultModule("Business Process") business_process_module = portal.getDefaultModule("Business Process")
business_process = getattr(business_process_module, business_process_id, None) business_process = getattr(business_process_module, business_process_id, None)
if business_process is None: if business_process is None:
...@@ -40,7 +38,7 @@ if state in ['planned', 'ordered']: ...@@ -40,7 +38,7 @@ if state in ['planned', 'ordered']:
specialise_value=business_process, specialise_value=business_process,
start_date=DateTime(), start_date=DateTime(),
) )
order_line = order.newContent( order.newContent(
portal_type=order_line_portal_type, portal_type=order_line_portal_type,
resource='product_module/%s' % resource_id, resource='product_module/%s' % resource_id,
quantity=1, quantity=1,
...@@ -63,7 +61,7 @@ else: ...@@ -63,7 +61,7 @@ else:
specialise_value=business_process, specialise_value=business_process,
start_date=DateTime(), start_date=DateTime(),
) )
delivery_line = delivery.newContent( delivery.newContent(
portal_type=delivery_line_portal_type, portal_type=delivery_line_portal_type,
resource='product_module/%s' % resource_id, resource='product_module/%s' % resource_id,
quantity=1, quantity=1,
...@@ -87,8 +85,6 @@ else: ...@@ -87,8 +85,6 @@ else:
break break
if delivery.getSimulationState() != state: 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." return "Delivery Created."
# vim: syntax=python
...@@ -2,8 +2,6 @@ portal = context.getPortalObject() ...@@ -2,8 +2,6 @@ portal = context.getPortalObject()
resource_portal_type = "Product" resource_portal_type = "Product"
node_portal_type = "Organisation" node_portal_type = "Organisation"
site_portal_type = "Category"
resource_id = "erp5_pdm_ui_test_product" resource_id = "erp5_pdm_ui_test_product"
source_node_id = "erp5_pdm_ui_test_source_node" source_node_id = "erp5_pdm_ui_test_source_node"
......
portal = context.getPortalObject() portal = context.getPortalObject()
self = context
resource_portal_type = "Product" resource_portal_type = "Product"
node_portal_type = "Organisation" node_portal_type = "Organisation"
...@@ -42,7 +41,7 @@ resource.validate() ...@@ -42,7 +41,7 @@ resource.validate()
base_category = portal.restrictedTraverse('portal_categories/site') base_category = portal.restrictedTraverse('portal_categories/site')
for site_id, site_title in ((source_site_id, source_site_title), for site_id, site_title in ((source_site_id, source_site_title),
(destination_site_id, destination_site_title)): (destination_site_id, destination_site_title)):
site = base_category.newContent( base_category.newContent(
portal_type=site_portal_type, portal_type=site_portal_type,
id=site_id, id=site_id,
title=site_title title=site_title
...@@ -52,7 +51,7 @@ for site_id, site_title in ((source_site_id, source_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), 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)): (destination_node_id, destination_node_title, destination_site_id)):
module = portal.getDefaultModule(node_portal_type) module = portal.getDefaultModule(node_portal_type)
node = module.newContent( module.newContent(
portal_type=node_portal_type, portal_type=node_portal_type,
id=node_id, id=node_id,
title=node_title, 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