Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
slapos.core
Commits
7f25c0eb
Commit
7f25c0eb
authored
Feb 04, 2023
by
Jérome Perrin
Committed by
Rafael Monnerat
Mar 01, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: use urlparse to check URL redirect
this does not depend on the details of the URL
parent
4e99e918
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
8 deletions
+23
-8
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
...omponents/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
+9
-4
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionSkins.py
...ortal_components/test.erp5.testSlapOSSubscriptionSkins.py
+14
-4
No files found.
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
View file @
7f25c0eb
...
...
@@ -19,6 +19,8 @@
#
##############################################################################
import
six
import
six.moves.urllib.parse
from
erp5.component.test.testSlapOSCloudSecurityGroup
import
TestSlapOSSecurityMixin
from
erp5.component.test.SlapOSTestCaseMixin
import
changeSkin
import
re
...
...
@@ -65,7 +67,7 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
email
=
'%s@example.com'
%
reference
re
quest
=
self
.
web_site
.
hateoas
.
connection
.
WebSection_newCredentialRequest
(
re
direct_url
=
self
.
web_site
.
hateoas
.
connection
.
WebSection_newCredentialRequest
(
reference
=
reference
,
default_email_text
=
email
,
first_name
=
"Joe"
,
...
...
@@ -77,9 +79,12 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
default_address_street_address
=
"Av Pelinca"
,
default_address_zip_code
=
"28480"
,
)
self
.
assertIn
(
'Thank you for your registration. You will receive an email to activate your account.'
,
request
)
parsed_url
=
six
.
moves
.
urllib
.
parse
.
urlparse
(
redirect_url
)
self
.
assertEqual
(
parsed_url
.
path
.
split
(
'/'
)[
-
1
],
'login_form'
)
self
.
assertEqual
(
sorted
(
six
.
iteritems
(
dict
(
six
.
moves
.
urllib
.
parse
.
parse_qsl
(
parsed_url
.
query
)))),
[
(
'portal_status_message'
,
'Thank you for your registration. You will receive an email to activate your account.'
),
])
self
.
tic
()
to_click_message
=
findMessage
(
email
,
'You have requested one user'
)
...
...
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionSkins.py
View file @
7f25c0eb
...
...
@@ -18,6 +18,10 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
##############################################################################
import
six
import
six.moves.urllib.parse
from
erp5.component.test.SlapOSTestCaseMixin
import
\
SlapOSTestCaseMixinWithAbort
,
simulate
from
zExceptions
import
Unauthorized
...
...
@@ -310,13 +314,19 @@ class Test0SubscriptionRequestModule_requestSubscriptionProxy(TestSubscriptionSk
self
.
tic
()
module
=
self
.
portal
.
web_site_module
.
hostingjs
.
subscription_request_module
re
sponse
=
module
.
SubscriptionRequestModule_requestSubscriptionProxy
(
re
direct_url
=
module
.
SubscriptionRequestModule_requestSubscriptionProxy
(
email
=
email
,
subscription_reference
=
subscription_reference
,
confirmation_required
=
True
,
user_input_dict
=
user_input_dict
)
self
.
assertTrue
(
response
.
endswith
(
"order_confirmation?field_your_reservation_name=Member Template&field_your_reservation_email=%s&field_your_reservation_number_of_machines=1&field_your_reservation_network=test_subscription_reference"
%
email
),
response
)
parsed_url
=
six
.
moves
.
urllib
.
parse
.
urlparse
(
redirect_url
)
self
.
assertEqual
(
parsed_url
.
path
.
split
(
'/'
)[
-
1
],
'order_confirmation'
)
self
.
assertEqual
(
sorted
(
six
.
iteritems
(
dict
(
six
.
moves
.
urllib
.
parse
.
parse_qsl
(
parsed_url
.
query
)))),
[
(
'field_your_reservation_email'
,
email
),
(
'field_your_reservation_name'
,
'Member Template'
),
(
'field_your_reservation_network'
,
'test_subscription_reference'
),
(
'field_your_reservation_number_of_machines'
,
'1'
),
])
# Missing tests XXXX
class
TestSubscriptionRequest_applyCondition
(
TestSubscriptionSkinsMixin
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment