Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
erp5
Commits
14ba26f0
Commit
14ba26f0
authored
Jul 17, 2013
by
Ivan Tyagov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test attachment creation.
parent
d6baaf8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
product/ERP5/tests/testERP5Discussion.py
product/ERP5/tests/testERP5Discussion.py
+17
-0
No files found.
product/ERP5/tests/testERP5Discussion.py
View file @
14ba26f0
...
...
@@ -33,6 +33,7 @@ import unittest
from
AccessControl.SecurityManagement
import
newSecurityManager
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5Type.tests.backportUnittest
import
expectedFailure
from
Products.ERP5OOo.tests.testDms
import
makeFileUpload
class
TestERP5Discussion
(
ERP5TypeTestCase
):
...
...
@@ -134,6 +135,22 @@ class TestERP5Discussion(ERP5TypeTestCase):
self
.
tic
()
# indexed already
self
.
assertSameSet
([
discussion_thread
],
web_section1
.
WebSection_getDiscussionThreadList
())
discussion_post
=
discussion_thread
.
contentValues
(
filter
=
{
'portal_type'
:
'Discussion Post'
})[
0
]
attachment_list
=
discussion_post
.
DiscussionPost_getAttachmentList
()
self
.
assertEqual
(
discussion_thread
.
getValidationState
(),
'published'
)
self
.
assertEqual
(
0
,
len
(
attachment_list
))
# check attachment creation
file
=
makeFileUpload
(
'TEST-en-002.doc'
)
web_section1
.
WebSection_createNewDiscussionThread
(
'test1-new-with-attachment'
,
'test1 body'
,
file
=
file
)
discussion_thread
=
[
x
for
x
in
self
.
portal
.
discussion_thread_module
.
objectValues
()
\
if
x
.
getReference
()
==
'test1-new-with-attachment'
][
0
]
self
.
tic
()
discussion_post
=
discussion_thread
.
contentValues
(
filter
=
{
'portal_type'
:
'Discussion Post'
})[
0
]
attachment_list
=
discussion_post
.
DiscussionPost_getAttachmentList
()
self
.
assertEqual
(
discussion_thread
.
getValidationState
(),
'published'
)
self
.
assertEqual
(
1
,
len
(
attachment_list
))
def
test_MultipleForum
(
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