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
Noah Brackenbury
erp5
Commits
95ab8e51
Commit
95ab8e51
authored
Jun 20, 2013
by
Benjamin Blanc
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://git.erp5.org/repos/erp5
parents
2b71d16c
3a862986
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
33 deletions
+8
-33
product/ERP5/tests/testXHTML.py
product/ERP5/tests/testXHTML.py
+8
-33
No files found.
product/ERP5/tests/testXHTML.py
View file @
95ab8e51
...
...
@@ -35,25 +35,10 @@ import urllib
from
subprocess
import
Popen
,
PIPE
from
Testing
import
ZopeTestCase
from
Products.ERP5Type.tests.ERP5TypeTestCase
import
ERP5TypeTestCase
from
Products.ERP5
import
__file__
as
ERP5PackagePath
from
Products.CMFCore.utils
import
getToolByName
from
zLOG
import
LOG
from
xml.dom
import
minidom
INSTANCE_HOME
=
os
.
environ
[
'INSTANCE_HOME'
]
bt5_base_path
=
os
.
environ
.
get
(
'erp5_tests_bt5_path'
,
os
.
path
.
join
(
INSTANCE_HOME
,
'bt5'
))
bootstrap_base_path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
ERP5PackagePath
),
'bootstrap'
)
# if Products.ERP5 is a git checkout, then this folder will contain bt5s
repository_base_path
=
os
.
path
.
join
(
os
.
path
.
dirname
(
ERP5PackagePath
),
'..'
,
'..'
,
'bt5'
)
bt5_search_path_list
=
'%s,%s,%s'
%
(
bt5_base_path
,
bootstrap_base_path
,
repository_base_path
)
# some forms have intentionally empty listbox selections like RSS generators
FORM_LISTBOX_EMPTY_SELECTION_PATH_LIST
=
[
'erp5_web_widget_library/WebSection_viewContentListAsRSS'
]
...
...
@@ -648,29 +633,19 @@ def addTestMethodDynamically(test_class, validator, target_business_templates):
from
Products.ERP5.tests.utils
import
BusinessTemplateInfoDir
business_template_info_list
=
[]
for
i
in
target_business_templates
:
for
bt5_search_path
in
bt5_search_path_list
.
split
(
','
):
business_template
=
os
.
path
.
join
(
bt5_search_path
,
i
)
business_template_info
=
None
if
(
os
.
path
.
exists
(
business_template
)
or
os
.
path
.
exists
(
'%s.bt5'
%
business_template
)):
if
os
.
path
.
isdir
(
business_template
):
business_template_info
=
BusinessTemplateInfoDir
(
business_template
)
elif
os
.
path
.
isfile
(
business_template
+
'.bt5'
):
business_template_info
=
BusinessTemplateInfoTar
(
business_template
+
'.bt5'
)
if
business_template_info
is
not
None
:
business_template_info_list
.
append
(
business_template_info
)
break
for
url
,
_
in
ERP5TypeTestCase
.
_getBTPathAndIdList
(
target_business_templates
):
if
os
.
path
.
isdir
(
url
):
business_template_info
=
BusinessTemplateInfoDir
(
url
)
else
:
raise
KeyError
,
"Can't find business template %s"
%
i
business_template_info
=
BusinessTemplateInfoTar
(
url
)
business_template_info_list
.
append
(
business_template_info
)
tested_portal_type_list
=
[]
for
business_template_info
in
business_template_info_list
:
for
module_id
,
module_portal_type
in
business_template_info
.
modules
.
items
():
portal_type_list
=
[
module_portal_type
,
]
+
\
business_template_info
.
allowed_content_types
.
get
(
module_portal_type
,
[])
portal_type_path_dict
=
{}
portal_type_path_dict
=
dict
(
map
(
None
,
portal_type_list
,
portal_type_list
))
portal_type_path_dict
=
dict
(
zip
(
portal_type_list
,
portal_type_list
))
testPortalTypeViewRecursivly
(
test_class
=
test_class
,
validator
=
validator
,
module_id
=
module_id
,
...
...
@@ -693,8 +668,8 @@ validator = None
# tidy or w3c may not be installed in livecd. Then we will skip xhtml validation tests.
# create the validator object
if
validator_to_use
==
'w3c'
:
default
=
'/usr/share/w3c-markup-validator/cgi-bin:/usr/lib/cgi-bin'
validator_path_list
=
os
.
environ
.
get
(
'CGI_PATH'
,
default
).
split
(
os
.
pathsep
)
validator_path_list
=
os
.
environ
.
get
(
'CGI_PATH'
,
'/usr/lib/cgi-bin:/usr/lib/cgi-bin/w3c-markup-validator'
).
split
(
os
.
pathsep
)
for
path
in
validator_path_list
:
validator_path
=
os
.
path
.
join
(
path
,
'check'
)
if
os
.
path
.
exists
(
validator_path
):
...
...
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