Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
slapos.core
Commits
26fd3cd6
Commit
26fd3cd6
authored
Sep 21, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore Person constraints.
parent
55c53707
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
262 additions
and
1 deletion
+262
-1
master/bt5/vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/VifibPersonConstraint.xml
...lateItem/portal_property_sheets/VifibPersonConstraint.xml
+4
-0
master/bt5/vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/VifibPersonConstraint/default_email_constraint.xml
...sheets/VifibPersonConstraint/default_email_constraint.xml
+50
-0
master/bt5/vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/VifibPersonConstraint/property_existence_constraint.xml
...s/VifibPersonConstraint/property_existence_constraint.xml
+67
-0
master/bt5/vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/VifibPersonConstraint/subordination_state_constraint.xml
.../VifibPersonConstraint/subordination_state_constraint.xml
+88
-0
master/bt5/vifib_erp5/TestTemplateItem/testVifibConstraint.py
...er/bt5/vifib_erp5/TestTemplateItem/testVifibConstraint.py
+52
-0
master/bt5/vifib_erp5/bt/revision
master/bt5/vifib_erp5/bt/revision
+1
-1
No files found.
master/bt5/vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/VifibPersonConstraint.xml
View file @
26fd3cd6
...
...
@@ -28,6 +28,10 @@
<key>
<string>
id
</string>
</key>
<value>
<string>
VifibPersonConstraint
</string>
</value>
</item>
<item>
<key>
<string>
last_id
</string>
</key>
<value>
<string>
3
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Property Sheet
</string>
</value>
...
...
master/bt5/vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/VifibPersonConstraint/default_email_constraint.xml
View file @
26fd3cd6
...
...
@@ -6,6 +6,18 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_identity_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_range_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
constraint_portal_type
</string>
</key>
<value>
<string>
python: (\'Email\',)
</string>
</value>
...
...
@@ -18,6 +30,14 @@
<key>
<string>
id
</string>
</key>
<value>
<string>
default_email_constraint
</string>
</value>
</item>
<item>
<key>
<string>
message_no_subobject
</string>
</key>
<value>
<string>
Person have to contain an Email
</string>
</value>
</item>
<item>
<key>
<string>
message_no_subobject_portal_type
</string>
</key>
<value>
<string>
Person have to contain an Email
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Content Existence Constraint
</string>
</value>
...
...
@@ -25,4 +45,34 @@
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/VifibPersonConstraint/property_existence_constraint.xml
View file @
26fd3cd6
...
...
@@ -6,6 +6,35 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_identity_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_local_properties
</string>
</key>
<value>
<tuple>
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
message_property_not_set
</string>
</value>
</item>
<item>
<key>
<string>
type
</string>
</key>
<value>
<string>
string
</string>
</value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key>
<string>
_range_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
constraint_property
</string>
</key>
<value>
...
...
@@ -22,6 +51,14 @@
<key>
<string>
id
</string>
</key>
<value>
<string>
property_existence_constraint
</string>
</value>
</item>
<item>
<key>
<string>
message_no_such_property
</string>
</key>
<value>
<string>
Property last_name must be defined
</string>
</value>
</item>
<item>
<key>
<string>
message_property_not_set
</string>
</key>
<value>
<string>
Property last_name must be defined
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Property Existence Constraint
</string>
</value>
...
...
@@ -29,4 +66,34 @@
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/VifibPersonConstraint/subordination_state_constraint.xml
0 → 100644
View file @
26fd3cd6
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Category Acquired Membership State Constraint"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_identity_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_range_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
base_category
</string>
</key>
<value>
<string>
subordination
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
subordination_state_constraint
</string>
</value>
</item>
<item>
<key>
<string>
membership_portal_type_list
</string>
</key>
<value>
<string>
python: (\'Organisation\',)
</string>
</value>
</item>
<item>
<key>
<string>
message_different_state
</string>
</key>
<value>
<string>
The Organisation is not validated
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Category Acquired Membership State Constraint
</string>
</value>
</item>
<item>
<key>
<string>
workflow_state_list
</string>
</key>
<value>
<string>
python: \'validated\'
</string>
</value>
</item>
<item>
<key>
<string>
workflow_variable
</string>
</key>
<value>
<string>
validation_state
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_erp5/TestTemplateItem/testVifibConstraint.py
View file @
26fd3cd6
...
...
@@ -284,3 +284,55 @@ class TestVifibInternalPackingListLineConstraint(testVifibMixin):
line
.
setAggregate
(
aggregate
.
getRelativeUrl
())
self
.
assertFalse
(
consistency_message
in
getMessageList
(
line
))
class
testVifibPersonConstraint
(
testVifibMixin
):
def
getTitle
(
self
):
return
"Vifib Person Constraint checks"
def
test_last_name_existence
(
self
):
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
)
consistency_message
=
'Property last_name must be defined'
self
.
assertTrue
(
consistency_message
in
getMessageList
(
person
))
person
.
setLastName
(
rndstr
())
self
.
assertFalse
(
consistency_message
in
getMessageList
(
person
))
def
test_role
(
self
):
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
)
consistency_message
=
'One role should be defined'
self
.
assertTrue
(
consistency_message
in
getMessageList
(
person
))
role_id_list
=
list
(
self
.
portal
.
portal_categories
.
role
.
objectIds
())
self
.
assertTrue
(
len
(
role_id_list
)
>=
2
)
person
.
setRole
(
role_id_list
[
0
])
self
.
assertFalse
(
consistency_message
in
getMessageList
(
person
))
person
.
setRoleList
(
role_id_list
)
self
.
assertTrue
(
consistency_message
in
getMessageList
(
person
))
person
.
setRole
(
role_id_list
[
0
])
self
.
assertFalse
(
consistency_message
in
getMessageList
(
person
))
def
test_subordination_state
(
self
):
organisation
=
self
.
portal
.
organisation_module
.
newContent
(
portal_type
=
'Organisation'
)
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
subordination
=
organisation
.
getRelativeUrl
())
consistency_message
=
'The Organisation is not validated'
self
.
assertTrue
(
consistency_message
in
getMessageList
(
person
))
organisation
.
validate
()
self
.
assertFalse
(
consistency_message
in
getMessageList
(
person
))
def
test_email
(
self
):
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
)
consistency_message
=
'Person have to contain an Email'
self
.
assertTrue
(
consistency_message
in
getMessageList
(
person
))
person
.
newContent
(
portal_type
=
'Email'
)
self
.
assertFalse
(
consistency_message
in
getMessageList
(
person
))
master/bt5/vifib_erp5/bt/revision
View file @
26fd3cd6
197
\ No newline at end of file
198
\ No newline at end of file
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