Commit 1b68f7d4 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼 Committed by Rafael Monnerat

slapos_subscription_request: fix typos

/reviewed-on nexedi/slapos.core!130
parent 6d7c4408
...@@ -32,10 +32,10 @@ for i in range(amount): ...@@ -32,10 +32,10 @@ for i in range(amount):
else: else:
json_parameter["kvm-partition-dict"]["KVM" + str(i)] = KVM0 json_parameter["kvm-partition-dict"]["KVM" + str(i)] = KVM0
xml_paramerter = """ xml_parameter = """
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<instance> <instance>
<parameter id="_">%s</parameter> <parameter id="_">%s</parameter>
</instance>""" % json.dumps(json_parameter, indent=2) </instance>""" % json.dumps(json_parameter, indent=2)
return xml_paramerter return xml_parameter
...@@ -18,7 +18,7 @@ user_input_dict = { ...@@ -18,7 +18,7 @@ user_input_dict = {
"name": name, "name": name,
"amount" : amount} "amount" : amount}
return context.SubscriptionRequestModule_requestSubscritptionProxy( return context.SubscriptionRequestModule_requestSubscriptionProxy(
default_email_text, subscription_reference, default_email_text, subscription_reference,
confirmation_required=bool(confirmation_required), confirmation_required=bool(confirmation_required),
user_input_dict=user_input_dict, batch_mode=0) user_input_dict=user_input_dict, batch_mode=0)
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>SubscriptionRequestModule_requestSubscritption</string> </value> <value> <string>SubscriptionRequestModule_requestSubscription</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>SubscriptionRequestModule_requestSubscritptionProxy</string> </value> <value> <string>SubscriptionRequestModule_requestSubscriptionProxy</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -325,7 +325,7 @@ class TestSlapOSTrialScenario(DefaultScenarioMixin): ...@@ -325,7 +325,7 @@ class TestSlapOSTrialScenario(DefaultScenarioMixin):
subscription_request.getRelativeUrl()) subscription_request.getRelativeUrl())
@changeSkin('Hal') @changeSkin('Hal')
def _requestSubscription(self, **kw): def _requestSubscription(self, **kw):
return self.web_site.hateoas.SubscriptionRequestModule_requestSubscritption(**kw) return self.web_site.hateoas.SubscriptionRequestModule_requestSubscription(**kw)
def getAggregatedSalePackingList(self, subscription_request, specialise): def getAggregatedSalePackingList(self, subscription_request, specialise):
person_uid = subscription_request.getDestinationSectionValue().getUid() person_uid = subscription_request.getDestinationSectionValue().getUid()
......
...@@ -179,39 +179,39 @@ class TestSubscriptionCondition_renderParameter(TestSubscriptionSkinsMixin): ...@@ -179,39 +179,39 @@ class TestSubscriptionCondition_renderParameter(TestSubscriptionSkinsMixin):
self.assertEqual(parameter_xml, subscription_condition.SubscriptionCondition_renderParameter(amount=1)) self.assertEqual(parameter_xml, subscription_condition.SubscriptionCondition_renderParameter(amount=1))
class TestSubscriptionRequestModule_requestSubscritption(TestSubscriptionSkinsMixin): class TestSubscriptionRequestModule_requestSubscription(TestSubscriptionSkinsMixin):
@simulate('SubscriptionRequestModule_requestSubscritptionProxy', '*args, **kwargs','return args, kwargs') @simulate('SubscriptionRequestModule_requestSubscriptionProxy', '*args, **kwargs','return args, kwargs')
def test_SubscriptionRequestModule_requestSubscritption(self): def test_SubscriptionRequestModule_requestSubscription(self):
module = self.portal.subscription_request_module module = self.portal.subscription_request_module
# Request is None, so it can only be called via URL # Request is None, so it can only be called via URL
self.assertRaises(Unauthorized, module.SubscriptionRequestModule_requestSubscritption, REQUEST=None) self.assertRaises(Unauthorized, module.SubscriptionRequestModule_requestSubscription, REQUEST=None)
# Method is not get # Method is not get
self.assertRaises(ValueError, module.SubscriptionRequestModule_requestSubscritption, self.assertRaises(ValueError, module.SubscriptionRequestModule_requestSubscription,
REQUEST=self.portal.REQUEST) REQUEST=self.portal.REQUEST)
# Method is not get # Method is not get
self.portal.REQUEST.other['method'] = "GET" self.portal.REQUEST.other['method'] = "GET"
# default_email_text not defined # default_email_text not defined
self.assertRaises(ValueError, module.SubscriptionRequestModule_requestSubscritption, self.assertRaises(ValueError, module.SubscriptionRequestModule_requestSubscription,
REQUEST=self.portal.REQUEST) REQUEST=self.portal.REQUEST)
# name not defined # name not defined
self.assertRaises(ValueError, module.SubscriptionRequestModule_requestSubscritption, self.assertRaises(ValueError, module.SubscriptionRequestModule_requestSubscription,
REQUEST=self.portal.REQUEST, default_email_text="123@nexedi.com") REQUEST=self.portal.REQUEST, default_email_text="123@nexedi.com")
# subscription_reference not defined # subscription_reference not defined
self.assertRaises(ValueError, module.SubscriptionRequestModule_requestSubscritption, self.assertRaises(ValueError, module.SubscriptionRequestModule_requestSubscription,
REQUEST=self.portal.REQUEST, default_email_text="123@nexedi.com", REQUEST=self.portal.REQUEST, default_email_text="123@nexedi.com",
name="couscous") name="couscous")
expected_argument_tuple = (('123@nexedi.com', 'subscription_reference'), expected_argument_tuple = (('123@nexedi.com', 'subscription_reference'),
{'confirmation_required': True, 'user_input_dict': {'name': "couscous", 'amount': 0}, 'batch_mode': 0}) {'confirmation_required': True, 'user_input_dict': {'name': "couscous", 'amount': 0}, 'batch_mode': 0})
self.assertEqual(expected_argument_tuple, module.SubscriptionRequestModule_requestSubscritption( self.assertEqual(expected_argument_tuple, module.SubscriptionRequestModule_requestSubscription(
REQUEST=self.portal.REQUEST, default_email_text="123@nexedi.com", REQUEST=self.portal.REQUEST, default_email_text="123@nexedi.com",
name="couscous", subscription_reference="subscription_reference")) name="couscous", subscription_reference="subscription_reference"))
self.tic() self.tic()
...@@ -300,14 +300,14 @@ class TestSubscriptionRequest_createUser(TestSubscriptionSkinsMixin): ...@@ -300,14 +300,14 @@ class TestSubscriptionRequest_createUser(TestSubscriptionSkinsMixin):
self.assertEqual(erp5_login.getReference(), person.getUserId()) self.assertEqual(erp5_login.getReference(), person.getUserId())
class Test0SubscriptionRequestModule_requestSubscritptionProxy(TestSubscriptionSkinsMixin): class Test0SubscriptionRequestModule_requestSubscriptionProxy(TestSubscriptionSkinsMixin):
def test0SubscriptionRequestModule_requestSubscritptionProxy_raises_unauthorized(self): def test0SubscriptionRequestModule_requestSubscriptionProxy_raises_unauthorized(self):
self.assertRaises(Unauthorized, self.assertRaises(Unauthorized,
self.portal.subscription_request_module.SubscriptionRequestModule_requestSubscritptionProxy, self.portal.subscription_request_module.SubscriptionRequestModule_requestSubscriptionProxy,
REQUEST="XXXXXXXXXXX", email="bb", subscription_reference="aa") REQUEST="XXXXXXXXXXX", email="bb", subscription_reference="aa")
def test0SubscriptionRequestModule_requestSubscritptionProxy_redirect_to_confirmation(self): def test0SubscriptionRequestModule_requestSubscriptionProxy_redirect_to_confirmation(self):
email = "abc%s@nexedi.com" % self.new_id email = "abc%s@nexedi.com" % self.new_id
subscription_reference = "test_subscription_reference" subscription_reference = "test_subscription_reference"
user_input_dict = {'name': "Cous Cous %s" % self.new_id, user_input_dict = {'name': "Cous Cous %s" % self.new_id,
...@@ -317,7 +317,7 @@ class Test0SubscriptionRequestModule_requestSubscritptionProxy(TestSubscriptionS ...@@ -317,7 +317,7 @@ class Test0SubscriptionRequestModule_requestSubscritptionProxy(TestSubscriptionS
self.tic() self.tic()
module = self.portal.web_site_module.hostingjs.subscription_request_module module = self.portal.web_site_module.hostingjs.subscription_request_module
response = module.SubscriptionRequestModule_requestSubscritptionProxy( response = module.SubscriptionRequestModule_requestSubscriptionProxy(
email=email, subscription_reference=subscription_reference, email=email, subscription_reference=subscription_reference,
confirmation_required=True, user_input_dict=user_input_dict) confirmation_required=True, user_input_dict=user_input_dict)
......
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