Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
9799d77b
Commit
9799d77b
authored
Feb 20, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: don't depend on the order of dict iteration
parent
625eb2cc
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
28 additions
and
12 deletions
+28
-12
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testFields.py
...estTemplateItem/portal_components/test.erp5.testFields.py
+8
-2
bt5/erp5_corporate_identity_test/SkinTemplateItem/portal_skins/erp5_corporate_identity_test/Base_generateCorporareIdentityTestReport.py
...identity_test/Base_generateCorporareIdentityTestReport.py
+1
-1
bt5/erp5_corporate_identity_test/TestTemplateItem/portal_components/test.erp5.testCorporateIdentityMethod.py
...ortal_components/test.erp5.testCorporateIdentityMethod.py
+2
-2
bt5/erp5_oauth_facebook_login/TestTemplateItem/portal_components/test.erp5.testFacebookLogin.py
...lateItem/portal_components/test.erp5.testFacebookLogin.py
+9
-4
bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/Foo_viewParallelListField/category_list.xml
.../erp5_ui_test/Foo_viewParallelListField/category_list.xml
+1
-1
bt5/erp5_web_ui_test/PathTemplateItem/portal_tests/erp5_web_zuite/testWebPageClone.zpt
...lateItem/portal_tests/erp5_web_zuite/testWebPageClone.zpt
+6
-1
product/ERP5OOo/tests/testIngestion.py
product/ERP5OOo/tests/testIngestion.py
+1
-1
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testFields.py
View file @
9799d77b
...
@@ -1180,8 +1180,11 @@ class TestCaptchaField(ERP5TypeTestCase):
...
@@ -1180,8 +1180,11 @@ class TestCaptchaField(ERP5TypeTestCase):
def
test_numeric_good_captcha
(
self
):
def
test_numeric_good_captcha
(
self
):
self
.
field
.
values
[
'captcha_type'
]
=
'numeric'
self
.
field
.
values
[
'captcha_type'
]
=
'numeric'
def
random_choice
(
seq
):
self
.
assertIn
(
'+'
,
seq
)
return
'+'
with
mock
.
patch
(
'Products.ERP5Form.CaptchaField.random.randint'
,
return_value
=
1
),
\
with
mock
.
patch
(
'Products.ERP5Form.CaptchaField.random.randint'
,
return_value
=
1
),
\
mock
.
patch
(
'Products.ERP5Form.CaptchaField.random.choice'
,
side_effect
=
lambda
seq
:
seq
[
0
]
):
mock
.
patch
(
'Products.ERP5Form.CaptchaField.random.choice'
,
side_effect
=
random_choice
):
field_html
=
self
.
field
.
render
(
REQUEST
=
self
.
portal
.
REQUEST
)
field_html
=
self
.
field
.
render
(
REQUEST
=
self
.
portal
.
REQUEST
)
self
.
assertIn
(
'1 plus 1'
,
field_html
)
self
.
assertIn
(
'1 plus 1'
,
field_html
)
self
.
assertIn
(
hashlib
.
md5
(
b'1 + 1'
).
hexdigest
(),
field_html
)
self
.
assertIn
(
hashlib
.
md5
(
b'1 + 1'
).
hexdigest
(),
field_html
)
...
@@ -1197,8 +1200,11 @@ class TestCaptchaField(ERP5TypeTestCase):
...
@@ -1197,8 +1200,11 @@ class TestCaptchaField(ERP5TypeTestCase):
def
test_numeric_bad_captcha
(
self
):
def
test_numeric_bad_captcha
(
self
):
self
.
field
.
values
[
'captcha_type'
]
=
'numeric'
self
.
field
.
values
[
'captcha_type'
]
=
'numeric'
def
random_choice
(
seq
):
self
.
assertIn
(
'+'
,
seq
)
return
'+'
with
mock
.
patch
(
'Products.ERP5Form.CaptchaField.random.randint'
,
return_value
=
1
),
\
with
mock
.
patch
(
'Products.ERP5Form.CaptchaField.random.randint'
,
return_value
=
1
),
\
mock
.
patch
(
'Products.ERP5Form.CaptchaField.random.choice'
,
side_effect
=
lambda
seq
:
seq
[
0
]
):
mock
.
patch
(
'Products.ERP5Form.CaptchaField.random.choice'
,
side_effect
=
random_choice
):
self
.
field
.
render
(
REQUEST
=
self
.
portal
.
REQUEST
)
self
.
field
.
render
(
REQUEST
=
self
.
portal
.
REQUEST
)
self
.
assertRaises
(
self
.
assertRaises
(
ValidationError
,
self
.
validator
.
validate
,
self
.
field
,
'field_test'
,
{
ValidationError
,
self
.
validator
.
validate
,
self
.
field
,
'field_test'
,
{
...
...
bt5/erp5_corporate_identity_test/SkinTemplateItem/portal_skins/erp5_corporate_identity_test/Base_generateCorporareIdentityTestReport.py
View file @
9799d77b
import
json
import
json
return
[
'test report %s'
%
json
.
dumps
(
kw
)]
return
[
'test report %s'
%
json
.
dumps
(
kw
,
sort_keys
=
True
)]
bt5/erp5_corporate_identity_test/TestTemplateItem/portal_components/test.erp5.testCorporateIdentityMethod.py
View file @
9799d77b
...
@@ -206,11 +206,11 @@ class TestCorporateIdentityMethod(ERP5TypeTestCase):
...
@@ -206,11 +206,11 @@ class TestCorporateIdentityMethod(ERP5TypeTestCase):
# it has no matter with/without follow up
# it has no matter with/without follow up
doc_content
=
'<div> <a href="sale_opportunity_module/template_test_embed_sale_opportunity?report=Base_generateCorporareIdentityTestReport&test=23"></a> </div>'
doc_content
=
'<div> <a href="sale_opportunity_module/template_test_embed_sale_opportunity?report=Base_generateCorporareIdentityTestReport&test=23"></a> </div>'
output
=
web_page_with_follow_up
.
WebPage_embedReportDocumentList
(
doc_content
)
output
=
web_page_with_follow_up
.
WebPage_embedReportDocumentList
(
doc_content
)
self
.
assertEqual
(
output
,
'<div> test report {"
test": "23", "document_language": null, "format": null
} </div>'
)
self
.
assertEqual
(
output
,
'<div> test report {"
document_language": null, "format": null, "test": "23"
} </div>'
)
doc_content
=
'<div> <a href="sale_opportunity_module/template_test_embed_sale_opportunity?report=Base_generateCorporareIdentityTestReport&test=23"></a> </div>'
doc_content
=
'<div> <a href="sale_opportunity_module/template_test_embed_sale_opportunity?report=Base_generateCorporareIdentityTestReport&test=23"></a> </div>'
output
=
web_page_no_follow_up
.
WebPage_embedReportDocumentList
(
doc_content
)
output
=
web_page_no_follow_up
.
WebPage_embedReportDocumentList
(
doc_content
)
self
.
assertEqual
(
output
,
'<div> test report {"
test": "23", "document_language": null, "format": null
} </div>'
)
self
.
assertEqual
(
output
,
'<div> test report {"
document_language": null, "format": null, "test": "23"
} </div>'
)
def
test_getTemplateProxyParameter_override_person
(
self
):
def
test_getTemplateProxyParameter_override_person
(
self
):
output_dict_list
=
self
.
test_person
.
Base_getTemplateProxyParameter
(
output_dict_list
=
self
.
test_person
.
Base_getTemplateProxyParameter
(
...
...
bt5/erp5_oauth_facebook_login/TestTemplateItem/portal_components/test.erp5.testFacebookLogin.py
View file @
9799d77b
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
#
#
##############################################################################
##############################################################################
import
six.moves.urllib.parse
import
uuid
import
uuid
import
mock
import
mock
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
...
@@ -92,11 +93,15 @@ class TestFacebookLogin(ERP5TypeTestCase):
...
@@ -92,11 +93,15 @@ class TestFacebookLogin(ERP5TypeTestCase):
self
.
logout
()
self
.
logout
()
self
.
portal
.
ERP5Site_redirectToFacebookLoginPage
()
self
.
portal
.
ERP5Site_redirectToFacebookLoginPage
()
location
=
self
.
portal
.
REQUEST
.
RESPONSE
.
getHeader
(
"Location"
)
location
=
self
.
portal
.
REQUEST
.
RESPONSE
.
getHeader
(
"Location"
)
self
.
assertIn
(
"https://www.facebook.com/v2.10/dialog/oauth?"
,
location
)
self
.
assertIn
(
"scope=email&redirect_uri="
,
location
)
self
.
assertIn
(
"client_id=%s"
%
CLIENT_ID
,
location
)
self
.
assertNotIn
(
"secret_key="
,
location
)
self
.
assertIn
(
"ERP5Site_callbackFacebookLogin"
,
location
)
self
.
assertIn
(
"ERP5Site_callbackFacebookLogin"
,
location
)
parsed_location
=
six
.
moves
.
urllib
.
parse
.
urlparse
(
location
)
self
.
assertEqual
(
parsed_location
.
hostname
,
'www.facebook.com'
)
self
.
assertEqual
(
parsed_location
.
path
,
'/v2.10/dialog/oauth'
)
params
=
dict
(
six
.
moves
.
urllib
.
parse
.
parse_qsl
(
parsed_location
.
query
))
self
.
assertEqual
(
params
[
'scope'
],
'email'
)
self
.
assertEqual
(
params
[
'client_id'
],
CLIENT_ID
)
self
.
assertIn
(
"redirect_uri"
,
params
)
self
.
assertNotIn
(
"secret_key"
,
params
)
def
test_existing_user
(
self
):
def
test_existing_user
(
self
):
self
.
login
()
self
.
login
()
...
...
bt5/erp5_ui_test/SkinTemplateItem/portal_skins/erp5_ui_test/Foo_viewParallelListField/category_list.xml
View file @
9799d77b
...
@@ -279,7 +279,7 @@
...
@@ -279,7 +279,7 @@
<dictionary>
<dictionary>
<item>
<item>
<key>
<string>
_text
</string>
</key>
<key>
<string>
_text
</string>
</key>
<value>
<string>
python: \' \'.join(
here.getCategoryList(
))
</string>
</value>
<value>
<string>
python: \' \'.join(
sorted(here.getCategoryList()
))
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
bt5/erp5_web_ui_test/PathTemplateItem/portal_tests/erp5_web_zuite/testWebPageClone.zpt
View file @
9799d77b
...
@@ -85,7 +85,12 @@
...
@@ -85,7 +85,12 @@
</tr>
</tr>
<tr>
<tr>
<td>
assertLocation
</td>
<td>
assertLocation
</td>
<td>
regexp:${base_url}/web_site_module/test_web_site/web_page_module/[^/]+(/view)+\?portal_status_message=Created%20Clone%20Web%20Page.
&
editable_mode:int=1
</td>
<td>
regexp:${base_url}/web_site_module/test_web_site/web_page_module/[^/]+(/view)+\?.*portal_status_message=Created%20Clone%20Web%20Page.
</td>
<td></td>
</tr>
<tr>
<td>
assertLocation
</td>
<td>
regexp:${base_url}/web_site_module/test_web_site/web_page_module/[^/]+(/view)+\?.*editable_mode:int=1
</td>
<td></td>
<td></td>
</tr>
</tr>
</tbody></table>
</tbody></table>
...
...
product/ERP5OOo/tests/testIngestion.py
View file @
9799d77b
...
@@ -1507,7 +1507,7 @@ class TestIngestion(IngestionTestCase):
...
@@ -1507,7 +1507,7 @@ class TestIngestion(IngestionTestCase):
self
.
assertEqual
([
'anybody'
],
document
.
getGroupList
())
self
.
assertEqual
([
'anybody'
],
document
.
getGroupList
())
document
.
discoverMetadata
(
document
.
getFilename
(),
other_user
.
Person_getUserId
())
document
.
discoverMetadata
(
document
.
getFilename
(),
other_user
.
Person_getUserId
())
self
.
assertEqual
(
[
'anybody/a1'
,
'anybody/a2'
],
document
.
getGroupList
()
)
self
.
assertEqual
(
sorted
(
document
.
getGroupList
()),
[
'anybody/a1'
,
'anybody/a2'
]
)
def
test_IngestionConfigurationByTypeBasedMethod_usecase1
(
self
):
def
test_IngestionConfigurationByTypeBasedMethod_usecase1
(
self
):
"""How to configure meta data discovery so that each time a file
"""How to configure meta data discovery so that each time a file
...
...
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