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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
erp5
Commits
f8e8eb86
Commit
f8e8eb86
authored
Jun 29, 2017
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: remove old way of running functional tests
parent
acba8dc0
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
459 deletions
+0
-459
product/ERP5Type/tests/runFunctionalTest.py
product/ERP5Type/tests/runFunctionalTest.py
+0
-370
product/ERP5Type/tests/sendMail.py
product/ERP5Type/tests/sendMail.py
+0
-89
No files found.
product/ERP5Type/tests/runFunctionalTest.py
deleted
100644 → 0
View file @
acba8dc0
This diff is collapsed.
Click to expand it.
product/ERP5Type/tests/sendMail.py
deleted
100644 → 0
View file @
acba8dc0
##############################################################################
#
# Copyright (c) 2007 Nexedi SARL and Contributors. All Rights Reserved.
# Kazuhiko <kazuhiko@nexedi.com>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
"""Send a mail with attachments.
"""
import
smtplib
import
re
from
email.mime.text
import
MIMEText
from
email.mime.multipart
import
MIMEMultipart
from
email.message
import
Message
def
sendMail
(
subject
,
body
,
attachments
=
[],
status
=
False
,
from_mail
=
'nobody@erp5.org'
,
to_mail
=
[
'erp5-report@erp5.org'
],
smtp_host
=
''
):
if
attachments
:
msg
=
MIMEMultipart
()
else
:
msg
=
Message
()
msg
[
'Subject'
]
=
subject
msg
[
'From'
]
=
from_mail
msg
[
'To'
]
=
', '
.
join
(
to_mail
)
msg
[
'X-ERP5-Tests'
]
=
'ERP5'
if
status
:
msg
[
'X-ERP5-Tests-Status'
]
=
'OK'
# Guarantees the message ends in a newline
msg
.
preamble
=
subject
msg
.
epilogue
=
''
if
attachments
:
mime_text
=
MIMEText
(
body
)
mime_text
.
add_header
(
'Content-Disposition'
,
'attachment'
,
filename
=
'body'
)
msg
.
attach
(
mime_text
)
html_re
=
re
.
compile
(
'<html>'
,
re
.
I
)
for
item
in
attachments
:
mime_text
=
MIMEText
(
item
)
if
html_re
.
match
(
item
):
mime_text
.
set_type
(
'text/html'
)
mime_text
.
add_header
(
'Content-Disposition'
,
'attachment'
,
filename
=
'attachment.html'
)
else
:
mime_text
.
add_header
(
'Content-Disposition'
,
'attachment'
,
filename
=
'attachment.txt'
)
msg
.
attach
(
mime_text
)
else
:
msg
.
set_payload
(
body
)
# Send the email via SMTP server.
if
smtp_host
:
s
=
smtplib
.
SMTP
(
smtp_host
)
else
:
s
=
smtplib
.
SMTP
()
s
.
connect
()
s
.
sendmail
(
from_mail
,
to_mail
,
msg
.
as_string
())
s
.
close
()
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