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
preetwinder
erp5
Commits
97c4955d
Commit
97c4955d
authored
Mar 05, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check that local properties are really removed.
parent
3b935ad2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
product/ERP5Type/tests/testConstraint.py
product/ERP5Type/tests/testConstraint.py
+6
-4
No files found.
product/ERP5Type/tests/testConstraint.py
View file @
97c4955d
...
...
@@ -1254,6 +1254,7 @@ class TestConstraint(PropertySheetTestCase):
id
=
'type_validity_constraint'
,
)
obj
=
self
.
_makeOne
()
obj
.
edit
(
default_organisation_title
=
'foo'
)
self
.
assertEqual
(
1
,
len
(
obj
.
_local_properties
))
self
.
assertEquals
([],
constraint
.
checkConsistency
(
obj
))
# now add a 'local_property' property defined on a property sheet
self
.
_addProperty
(
obj
.
getPortalType
(),
"FixLocalPropertiesContent"
,
...
...
@@ -1271,8 +1272,8 @@ class TestConstraint(PropertySheetTestCase):
ti
.
_setTypeAllowedContentTypeList
(
allowed_types
+
[
'Organisation'
])
transaction
.
commit
()
try
:
self
.
assertEqual
([
'Property local_property was migrated from local properties.'
],
[
str
(
q
.
getMessage
())
for
q
in
constraint
.
fixConsistency
(
obj
)]
)
constraint
.
fixConsistency
(
obj
)
self
.
assertEqual
(
0
,
len
(
obj
.
_local_properties
)
)
self
.
assertEquals
(
'foo'
,
obj
.
getDefaultOrganisationTitle
())
self
.
assertEquals
(
'foo'
,
obj
.
default_organisation
.
getTitle
())
finally
:
...
...
@@ -1290,15 +1291,16 @@ class TestConstraint(PropertySheetTestCase):
id
=
'type_validity_constraint'
,
)
obj
=
self
.
_makeOne
()
obj
.
edit
(
testing_category
=
obj
.
getRelativeUrl
())
self
.
assertEqual
(
1
,
len
(
obj
.
_local_properties
))
self
.
assertEquals
([],
constraint
.
checkConsistency
(
obj
))
# now add a 'local_property' property defined on a property sheet
self
.
_addProperty
(
obj
.
getPortalType
(),
"FixForCategories"
,
portal_type
=
"Category Property"
,
property_id
=
"testing_category"
)
# fix consistency
self
.
assertEqual
([
'Property local_property was migrated from local properties.'
],
[
str
(
q
.
getMessage
())
for
q
in
constraint
.
fixConsistency
(
obj
)])
constraint
.
fixConsistency
(
obj
)
# now we can use testing_category as any category accessor
self
.
assertEqual
(
0
,
len
(
obj
.
_local_properties
))
self
.
assertEquals
(
obj
,
obj
.
getTestingCategoryValue
())
def
stepCreateContentExistence
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
...
...
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