Commit 8c7f556e authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_subscription_request: Make Pylint Happy

parent 2cf5ea7c
......@@ -22,8 +22,8 @@ def Base_instanceXmlToDict(self, xml):
else:
value = element.text
result_dict[key] = value
except (etree.XMLSchemaError, etree.XMLSchemaParseError,
etree.XMLSchemaValidateError, etree.XMLSyntaxError):
except (etree.XMLSchemaError, etree.XMLSchemaParseError, #pylint: disable=catching-non-exception
etree.XMLSchemaValidateError, etree.XMLSyntaxError): #pylint: disable=catching-non-exception
LOG('SubscriptionRequest', INFO, 'Issue during parsing xml:', error=True)
return result_dict
......
......@@ -31,7 +31,6 @@ subscription_request = context.subscription_request_module.newContent(
subscription_request.setDefaultEmailText(email)
def wrapWithShadow(subscription_request, amount, subscription_reference, subscription_request_id):
subscription_request.activate(tag="subscription_condition_%s" % subscription_request_id
).SubscriptionRequest_applyCondition(subscription_reference, target_language)
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>email, subscription_reference, confirmation_required=False, user_input_dict={}, target_language=None, batch_mode=True, REQUEST=None</string> </value>
<value> <string>email, subscription_reference, confirmation_required=False, user_input_dict=None, target_language=None, batch_mode=True, REQUEST=None</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
......
from zExceptions import Unauthorized
if REQUEST is not None:
pass #raise Unauthorized
raise Unauthorized
portal = context.getObject()
......
......@@ -6,6 +6,9 @@ if REQUEST is not None:
portal = context.getPortalObject()
if user_input_dict is None:
user_input_dict = {}
if context.getValidationState() not in ["validated", "published"]:
raise ValueError("This Trial Condition isn't validated.")
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>email, user_input_dict={}, batch_mode=True, REQUEST=None</string> </value>
<value> <string>email, user_input_dict=None, batch_mode=True, REQUEST=None</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
......
......@@ -6,12 +6,6 @@
##############################################################################
from erp5.component.test.SlapOSTestCaseDefaultScenarioMixin import DefaultScenarioMixin
from erp5.component.test.SlapOSTestCaseMixin import changeSkin
import re
import json
import xml_marshaller
from AccessControl.SecurityManagement import getSecurityManager, \
setSecurityManager
from DateTime import DateTime
class TestSlapOSTrialScenario(DefaultScenarioMixin):
......
......@@ -45,14 +45,7 @@
<item>
<key> <string>text_content_warning_message</string> </key>
<value>
<tuple>
<string>W: 9, 0: Unused changeSkin imported from erp5.component.test.SlapOSTestCaseMixin (unused-import)</string>
<string>W: 10, 0: Unused import re (unused-import)</string>
<string>W: 11, 0: Unused import json (unused-import)</string>
<string>W: 12, 0: Unused import xml_marshaller (unused-import)</string>
<string>W: 13, 0: Unused getSecurityManager imported from AccessControl.SecurityManagement (unused-import)</string>
<string>W: 13, 0: Unused setSecurityManager imported from AccessControl.SecurityManagement (unused-import)</string>
</tuple>
<tuple/>
</value>
</item>
<item>
......
object = state_change['object']
object.Base_checkConsistency()
subscription_request = state_change['object']
subscription_request.Base_checkConsistency()
object = state_change['object']
object.Base_checkConsistency()
trial_request = state_change['object']
trial_request.Base_checkConsistency()
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