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
Ivan Tyagov
slapos.core
Commits
325559e7
Commit
325559e7
authored
Sep 21, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore Email constraints.
parent
e44d69a2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
267 additions
and
1 deletion
+267
-1
master/bt5/vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/VifibEmailConstraint.xml
...plateItem/portal_property_sheets/VifibEmailConstraint.xml
+44
-0
master/bt5/vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/VifibEmailConstraint/email_not_empty_constraint.xml
...heets/VifibEmailConstraint/email_not_empty_constraint.xml
+105
-0
master/bt5/vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/VifibEmailConstraint/email_unicity_constraint.xml
..._sheets/VifibEmailConstraint/email_unicity_constraint.xml
+84
-0
master/bt5/vifib_erp5/TestTemplateItem/testVifibConstraint.py
...er/bt5/vifib_erp5/TestTemplateItem/testVifibConstraint.py
+33
-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/VifibEmailConstraint.xml
View file @
325559e7
...
...
@@ -6,10 +6,32 @@
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_count
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_mt_index
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_tree
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
VifibEmailConstraint
</string>
</value>
</item>
<item>
<key>
<string>
last_id
</string>
</key>
<value>
<string>
2
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Property Sheet
</string>
</value>
...
...
@@ -17,4 +39,26 @@
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Length"
module=
"BTrees.Length"
/>
</pickle>
<pickle>
<int>
0
</int>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/VifibEmailConstraint/email_not_empty_constraint.xml
0 → 100644
View file @
325559e7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"String Attribute Match 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>
_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>
<tuple>
<string>
url_string
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
email_not_empty_constraint
</string>
</value>
</item>
<item>
<key>
<string>
message_attribute_match
</string>
</key>
<value>
<string>
Email must be defined
</string>
</value>
</item>
<item>
<key>
<string>
message_no_such_property
</string>
</key>
<value>
<string>
Email must be defined
</string>
</value>
</item>
<item>
<key>
<string>
message_property_not_set
</string>
</key>
<value>
<string>
Email must be defined
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
String Attribute Match Constraint
</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/PropertySheetTemplateItem/portal_property_sheets/VifibEmailConstraint/email_unicity_constraint.xml
0 → 100644
View file @
325559e7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Attribute Unicity 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>
constraint_property
</string>
</key>
<value>
<tuple>
<string>
url_string
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
filter_parameter
</string>
</key>
<value>
<string>
python: {\'portal_type\': object.getPortalType(), \'url_string\': object.getUrlString()}
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
email_unicity_constraint
</string>
</value>
</item>
<item>
<key>
<string>
message_invalid_attribute_unicity
</string>
</key>
<value>
<string>
Email must be unique
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Attribute Unicity Constraint
</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 @
325559e7
...
...
@@ -128,3 +128,36 @@ class TestVifibComputerConstraint(testVifibMixin):
self
.
assertFalse
(
consistency_message
in
getMessageList
(
computer
))
self
.
assertFalse
(
consistency_message
in
getMessageList
(
computer_2
))
class
TestVifibEmailConstraint
(
testVifibMixin
):
def
getTitle
(
self
):
return
"Vifib Email Constraint checks"
def
test_url_string_not_empty
(
self
):
email
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
).
newContent
(
portal_type
=
'Email'
)
consistency_message
=
'Email must be defined'
self
.
assertTrue
(
consistency_message
in
getMessageList
(
email
))
email
.
setUrlString
(
rndstr
())
self
.
assertFalse
(
consistency_message
in
getMessageList
(
email
))
def
test_url_string_unique
(
self
):
url_string
=
rndstr
()
url_string_2
=
rndstr
()
email
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
).
newContent
(
portal_type
=
'Email'
,
url_string
=
url_string
)
email_2
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
).
newContent
(
portal_type
=
'Email'
,
url_string
=
url_string
)
consistency_message
=
'Email must be unique'
self
.
stepTic
()
self
.
assertTrue
(
consistency_message
in
getMessageList
(
email
))
self
.
assertTrue
(
consistency_message
in
getMessageList
(
email_2
))
email_2
.
setUrlString
(
url_string_2
)
self
.
stepTic
()
self
.
assertFalse
(
consistency_message
in
getMessageList
(
email
))
self
.
assertFalse
(
consistency_message
in
getMessageList
(
email_2
))
master/bt5/vifib_erp5/bt/revision
View file @
325559e7
194
\ No newline at end of file
195
\ 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