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
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
Nikola Balog
erp5
Commits
166da65a
Commit
166da65a
authored
Jan 31, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
testKM: py3
parent
8bd2a320
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
bt5/erp5_km/TestTemplateItem/portal_components/test.erp5.testKM.py
...km/TestTemplateItem/portal_components/test.erp5.testKM.py
+18
-18
No files found.
bt5/erp5_km/TestTemplateItem/portal_components/test.erp5.testKM.py
View file @
166da65a
...
@@ -430,7 +430,7 @@ class TestKM(TestKMMixIn):
...
@@ -430,7 +430,7 @@ class TestKM(TestKMMixIn):
#self.changeSkin('KM')
#self.changeSkin('KM')
url
=
'%s/ERP5Site_viewHomeAreaRenderer?gadget_mode=web_front'
%
self
.
web_site_url
url
=
'%s/ERP5Site_viewHomeAreaRenderer?gadget_mode=web_front'
%
self
.
web_site_url
response
=
self
.
publish
(
url
,
self
.
auth
)
response
=
self
.
publish
(
url
,
self
.
auth
)
self
.
assertIn
(
self
.
web_front_knowledge_pad
.
getTitle
(),
response
.
getBody
())
self
.
assertIn
(
self
.
web_front_knowledge_pad
.
getTitle
()
.
encode
()
,
response
.
getBody
())
# Web Front gadgets
# Web Front gadgets
web_front_gadgets
=
[
km_my_tasks_gadget
,
km_my_documents_gadget
,
km_my_contacts_gadget
]
web_front_gadgets
=
[
km_my_tasks_gadget
,
km_my_documents_gadget
,
km_my_contacts_gadget
]
...
@@ -441,7 +441,7 @@ class TestKM(TestKMMixIn):
...
@@ -441,7 +441,7 @@ class TestKM(TestKMMixIn):
# check that gadgets are added to web front page view
# check that gadgets are added to web front page view
response
=
self
.
publish
(
url
,
self
.
auth
)
response
=
self
.
publish
(
url
,
self
.
auth
)
for
gadget
in
web_front_gadgets
:
for
gadget
in
web_front_gadgets
:
self
.
assertIn
(
gadget
.
getTitle
(),
response
.
getBody
())
self
.
assertIn
(
gadget
.
getTitle
()
.
encode
()
,
response
.
getBody
())
def
test_05MyTaskGadget
(
self
):
def
test_05MyTaskGadget
(
self
):
""" Check My Task Gadgets """
""" Check My Task Gadgets """
...
@@ -479,8 +479,8 @@ class TestKM(TestKMMixIn):
...
@@ -479,8 +479,8 @@ class TestKM(TestKMMixIn):
self
.
webpage
.
getRelativeUrl
(),
self
.
webpage
.
getRelativeUrl
(),
km_my_tasks_box_url
)
km_my_tasks_box_url
)
,
self
.
auth
)]:
,
self
.
auth
)]:
self
.
assertIn
(
project
.
getTitle
(),
response
.
getBody
())
self
.
assertIn
(
project
.
getTitle
()
.
encode
()
,
response
.
getBody
())
self
.
assertIn
(
visit
.
getTitle
(),
response
.
getBody
())
self
.
assertIn
(
visit
.
getTitle
()
.
encode
()
,
response
.
getBody
())
def
test_06MyDocumentsGadget
(
self
):
def
test_06MyDocumentsGadget
(
self
):
""" Check My Document Gadgets """
""" Check My Document Gadgets """
...
@@ -522,8 +522,8 @@ class TestKM(TestKMMixIn):
...
@@ -522,8 +522,8 @@ class TestKM(TestKMMixIn):
self
.
webpage
.
getRelativeUrl
(),
self
.
webpage
.
getRelativeUrl
(),
km_my_documents_gadget_box_url
)
km_my_documents_gadget_box_url
)
,
self
.
auth
)]:
,
self
.
auth
)]:
self
.
assertIn
(
web_page
.
getTitle
(),
response
.
getBody
())
self
.
assertIn
(
web_page
.
getTitle
()
.
encode
()
,
response
.
getBody
())
self
.
assertIn
(
presentation
.
getTitle
(),
response
.
getBody
())
self
.
assertIn
(
presentation
.
getTitle
()
.
encode
()
,
response
.
getBody
())
def
test_07MyContactsGadget
(
self
):
def
test_07MyContactsGadget
(
self
):
""" Check My Contacts Gadgets """
""" Check My Contacts Gadgets """
...
@@ -559,7 +559,7 @@ class TestKM(TestKMMixIn):
...
@@ -559,7 +559,7 @@ class TestKM(TestKMMixIn):
self
.
webpage
.
getRelativeUrl
(),
self
.
webpage
.
getRelativeUrl
(),
km_my_contacts_gadget_box_url
)
km_my_contacts_gadget_box_url
)
,
self
.
auth
)]:
,
self
.
auth
)]:
self
.
assertIn
(
person
.
getTitle
(),
response
.
getBody
())
self
.
assertIn
(
person
.
getTitle
()
.
encode
()
,
response
.
getBody
())
def
test_08WebSectionGadget
(
self
):
def
test_08WebSectionGadget
(
self
):
""" Check Web Section Gadgets """
""" Check Web Section Gadgets """
...
@@ -578,7 +578,7 @@ class TestKM(TestKMMixIn):
...
@@ -578,7 +578,7 @@ class TestKM(TestKMMixIn):
self
.
web_section_url
+
'/WebSection_viewKnowledgePadColumn?gadget_mode='
,
self
.
auth
)
self
.
web_section_url
+
'/WebSection_viewKnowledgePadColumn?gadget_mode='
,
self
.
auth
)
for
gadget
in
web_section_gadgets
:
for
gadget
in
web_section_gadgets
:
self
.
assertIn
(
gadget
.
getTitle
(),
response
.
getBody
())
self
.
assertIn
(
gadget
.
getTitle
()
.
encode
()
,
response
.
getBody
())
def
test_10LatestContentGadget
(
self
):
def
test_10LatestContentGadget
(
self
):
""" Check Latest Content Gadgets """
""" Check Latest Content Gadgets """
...
@@ -619,7 +619,7 @@ class TestKM(TestKMMixIn):
...
@@ -619,7 +619,7 @@ class TestKM(TestKMMixIn):
presentation
.
publish
()
presentation
.
publish
()
self
.
tic
()
self
.
tic
()
self
.
changeSkin
(
'KM'
)
self
.
changeSkin
(
'KM'
)
self
.
assertIn
(
presentation
.
getTitle
(),
self
.
assertIn
(
presentation
.
getTitle
()
.
encode
()
,
self
.
publish
(
self
.
base_url_pattern
self
.
publish
(
self
.
base_url_pattern
%
(
self
.
web_section_url
+
'/%s'
%
latest_docs_subsection
.
getId
(),
%
(
self
.
web_section_url
+
'/%s'
%
latest_docs_subsection
.
getId
(),
gadget_view_form_id
,
gadget_view_form_id
,
...
@@ -647,7 +647,7 @@ class TestKM(TestKMMixIn):
...
@@ -647,7 +647,7 @@ class TestKM(TestKMMixIn):
self
.
web_section_knowledge_pad
,
self
.
web_section_knowledge_pad
,
km_assigned_member_gadget
)
km_assigned_member_gadget
)
self
.
changeSkin
(
'KM'
)
self
.
changeSkin
(
'KM'
)
self
.
assertIn
(
'No result'
,
self
.
assertIn
(
b
'No result'
,
self
.
publish
(
self
.
base_url_pattern
self
.
publish
(
self
.
base_url_pattern
%
(
self
.
web_section_url
+
'/%s'
%
assigned_members_subsection
.
getId
(),
%
(
self
.
web_section_url
+
'/%s'
%
assigned_members_subsection
.
getId
(),
gadget_view_form_id
,
gadget_view_form_id
,
...
@@ -661,7 +661,7 @@ class TestKM(TestKMMixIn):
...
@@ -661,7 +661,7 @@ class TestKM(TestKMMixIn):
assignment
=
person
.
newContent
(
portal_type
=
'Assignment'
,
destination_project_value
=
project
)
assignment
=
person
.
newContent
(
portal_type
=
'Assignment'
,
destination_project_value
=
project
)
self
.
tic
()
self
.
tic
()
self
.
changeSkin
(
'KM'
)
self
.
changeSkin
(
'KM'
)
self
.
assertIn
(
person
.
getTitle
(),
self
.
assertIn
(
person
.
getTitle
()
.
encode
()
,
self
.
publish
(
self
.
base_url_pattern
self
.
publish
(
self
.
base_url_pattern
%
(
self
.
web_section_url
+
'/%s'
%
assigned_members_subsection
.
getId
(),
%
(
self
.
web_section_url
+
'/%s'
%
assigned_members_subsection
.
getId
(),
gadget_view_form_id
,
gadget_view_form_id
,
...
@@ -687,7 +687,7 @@ class TestKM(TestKMMixIn):
...
@@ -687,7 +687,7 @@ class TestKM(TestKMMixIn):
self
.
web_section_url
+
'/WebSection_viewKnowledgePadColumn?gadget_mode='
,
self
.
auth
)
self
.
web_section_url
+
'/WebSection_viewKnowledgePadColumn?gadget_mode='
,
self
.
auth
)
for
gadget
in
web_section_content_gadgets
:
for
gadget
in
web_section_content_gadgets
:
self
.
assertIn
(
gadget
.
getTitle
(),
response
.
getBody
())
self
.
assertIn
(
gadget
.
getTitle
()
.
encode
()
,
response
.
getBody
())
def
test_12RelationGadget
(
self
):
def
test_12RelationGadget
(
self
):
""" Check Relation Gadgets """
""" Check Relation Gadgets """
...
@@ -716,7 +716,7 @@ class TestKM(TestKMMixIn):
...
@@ -716,7 +716,7 @@ class TestKM(TestKMMixIn):
gadget_view_form_id
)
gadget_view_form_id
)
# no related docs should exist
# no related docs should exist
self
.
assertIn
(
'No result.'
,
relation_form_renderer
())
self
.
assertIn
(
b
'No result.'
,
relation_form_renderer
())
# set related docs
# set related docs
similar_doc
=
portal
.
web_page_module
.
newContent
(
similar_doc
=
portal
.
web_page_module
.
newContent
(
...
@@ -766,19 +766,19 @@ class TestKM(TestKMMixIn):
...
@@ -766,19 +766,19 @@ class TestKM(TestKMMixIn):
old_gadget_view_form_id
=
gadget
.
view_form_id
old_gadget_view_form_id
=
gadget
.
view_form_id
gadget
.
view_form_id
=
'NO_SUCH_FORM_EXISTS'
gadget
.
view_form_id
=
'NO_SUCH_FORM_EXISTS'
response
=
self
.
publish
(
url
,
self
.
auth
)
response
=
self
.
publish
(
url
,
self
.
auth
)
self
.
assertIn
(
'Server side error'
,
response
.
getBody
())
self
.
assertIn
(
b
'Server side error'
,
response
.
getBody
())
gadget
.
view_form_id
=
old_gadget_view_form_id
gadget
.
view_form_id
=
old_gadget_view_form_id
response
=
self
.
publish
(
url
,
self
.
auth
)
response
=
self
.
publish
(
url
,
self
.
auth
)
self
.
assertNotIn
(
'Server side error'
,
response
.
getBody
())
self
.
assertNotIn
(
b
'Server side error'
,
response
.
getBody
())
# set non existent edit_form
# set non existent edit_form
old_gadget_edit_form_id
=
gadget
.
edit_form_id
old_gadget_edit_form_id
=
gadget
.
edit_form_id
gadget
.
edit_form_id
=
'NO_SUCH_FORM_EXISTS'
gadget
.
edit_form_id
=
'NO_SUCH_FORM_EXISTS'
response
=
self
.
publish
(
url
,
self
.
auth
)
response
=
self
.
publish
(
url
,
self
.
auth
)
self
.
assertIn
(
'Server side error'
,
response
.
getBody
())
self
.
assertIn
(
b
'Server side error'
,
response
.
getBody
())
gadget
.
edit_form_id
=
old_gadget_edit_form_id
gadget
.
edit_form_id
=
old_gadget_edit_form_id
response
=
self
.
publish
(
url
,
self
.
auth
)
response
=
self
.
publish
(
url
,
self
.
auth
)
self
.
assertNotIn
(
'Server side error'
,
response
.
getBody
())
self
.
assertNotIn
(
b
'Server side error'
,
response
.
getBody
())
def
test_16WebSiteBrowserGadget
(
self
):
def
test_16WebSiteBrowserGadget
(
self
):
"""
"""
...
@@ -812,7 +812,7 @@ class TestKM(TestKMMixIn):
...
@@ -812,7 +812,7 @@ class TestKM(TestKMMixIn):
subsection
.
edit
(
visible
=
True
)
subsection
.
edit
(
visible
=
True
)
self
.
tic
()
self
.
tic
()
self
.
changeSkin
(
'KM'
)
self
.
changeSkin
(
'KM'
)
self
.
assertIn
(
subsection
.
getTitle
(),
self
.
assertIn
(
subsection
.
getTitle
()
.
encode
()
,
self
.
publish
(
url
,
self
.
auth
).
getBody
())
self
.
publish
(
url
,
self
.
auth
).
getBody
())
def
test_17AddGadgets
(
self
):
def
test_17AddGadgets
(
self
):
...
...
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