Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
preetwinder
erp5
Commits
97c4955d
Commit
97c4955d
authored
13 years ago
by
Łukasz Nowak
Browse files
Options
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):
...
@@ -1254,6 +1254,7 @@ class TestConstraint(PropertySheetTestCase):
id
=
'type_validity_constraint'
,
)
id
=
'type_validity_constraint'
,
)
obj
=
self
.
_makeOne
()
obj
=
self
.
_makeOne
()
obj
.
edit
(
default_organisation_title
=
'foo'
)
obj
.
edit
(
default_organisation_title
=
'foo'
)
self
.
assertEqual
(
1
,
len
(
obj
.
_local_properties
))
self
.
assertEquals
([],
constraint
.
checkConsistency
(
obj
))
self
.
assertEquals
([],
constraint
.
checkConsistency
(
obj
))
# now add a 'local_property' property defined on a property sheet
# now add a 'local_property' property defined on a property sheet
self
.
_addProperty
(
obj
.
getPortalType
(),
"FixLocalPropertiesContent"
,
self
.
_addProperty
(
obj
.
getPortalType
(),
"FixLocalPropertiesContent"
,
...
@@ -1271,8 +1272,8 @@ class TestConstraint(PropertySheetTestCase):
...
@@ -1271,8 +1272,8 @@ class TestConstraint(PropertySheetTestCase):
ti
.
_setTypeAllowedContentTypeList
(
allowed_types
+
[
'Organisation'
])
ti
.
_setTypeAllowedContentTypeList
(
allowed_types
+
[
'Organisation'
])
transaction
.
commit
()
transaction
.
commit
()
try
:
try
:
self
.
assertEqual
([
'Property local_property was migrated from local properties.'
],
constraint
.
fixConsistency
(
obj
)
[
str
(
q
.
getMessage
())
for
q
in
constraint
.
fixConsistency
(
obj
)]
)
self
.
assertEqual
(
0
,
len
(
obj
.
_local_properties
)
)
self
.
assertEquals
(
'foo'
,
obj
.
getDefaultOrganisationTitle
())
self
.
assertEquals
(
'foo'
,
obj
.
getDefaultOrganisationTitle
())
self
.
assertEquals
(
'foo'
,
obj
.
default_organisation
.
getTitle
())
self
.
assertEquals
(
'foo'
,
obj
.
default_organisation
.
getTitle
())
finally
:
finally
:
...
@@ -1290,15 +1291,16 @@ class TestConstraint(PropertySheetTestCase):
...
@@ -1290,15 +1291,16 @@ class TestConstraint(PropertySheetTestCase):
id
=
'type_validity_constraint'
,
)
id
=
'type_validity_constraint'
,
)
obj
=
self
.
_makeOne
()
obj
=
self
.
_makeOne
()
obj
.
edit
(
testing_category
=
obj
.
getRelativeUrl
())
obj
.
edit
(
testing_category
=
obj
.
getRelativeUrl
())
self
.
assertEqual
(
1
,
len
(
obj
.
_local_properties
))
self
.
assertEquals
([],
constraint
.
checkConsistency
(
obj
))
self
.
assertEquals
([],
constraint
.
checkConsistency
(
obj
))
# now add a 'local_property' property defined on a property sheet
# now add a 'local_property' property defined on a property sheet
self
.
_addProperty
(
obj
.
getPortalType
(),
"FixForCategories"
,
self
.
_addProperty
(
obj
.
getPortalType
(),
"FixForCategories"
,
portal_type
=
"Category Property"
,
portal_type
=
"Category Property"
,
property_id
=
"testing_category"
)
property_id
=
"testing_category"
)
# fix consistency
# fix consistency
self
.
assertEqual
([
'Property local_property was migrated from local properties.'
],
constraint
.
fixConsistency
(
obj
)
[
str
(
q
.
getMessage
())
for
q
in
constraint
.
fixConsistency
(
obj
)])
# now we can use testing_category as any category accessor
# now we can use testing_category as any category accessor
self
.
assertEqual
(
0
,
len
(
obj
.
_local_properties
))
self
.
assertEquals
(
obj
,
obj
.
getTestingCategoryValue
())
self
.
assertEquals
(
obj
,
obj
.
getTestingCategoryValue
())
def
stepCreateContentExistence
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
def
stepCreateContentExistence
(
self
,
sequence
=
None
,
sequence_list
=
None
,
**
kw
):
...
...
This diff is collapsed.
Click to expand it.
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