Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
104
Merge Requests
104
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
c40ffec6
Commit
c40ffec6
authored
Sep 20, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore Software Product constraint.
They were lost during migration from filesystem based constraint.
parent
f0817fe7
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
304 additions
and
2 deletions
+304
-2
master/bt5/vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/VifibSoftwareProductConstraint.xml
...portal_property_sheets/VifibSoftwareProductConstraint.xml
+44
-0
master/bt5/vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/VifibSoftwareProductConstraint/title_not_empty_constraint.xml
...bSoftwareProductConstraint/title_not_empty_constraint.xml
+105
-0
master/bt5/vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/VifibSoftwareProductConstraint/title_unicity_constraint.xml
...fibSoftwareProductConstraint/title_unicity_constraint.xml
+82
-0
master/bt5/vifib_erp5/TestTemplateItem/testVifibConstraint.py
...er/bt5/vifib_erp5/TestTemplateItem/testVifibConstraint.py
+70
-0
master/bt5/vifib_erp5/bt/revision
master/bt5/vifib_erp5/bt/revision
+1
-1
master/bt5/vifib_erp5/bt/template_test_id_list
master/bt5/vifib_erp5/bt/template_test_id_list
+2
-1
No files found.
master/bt5/vifib_erp5/PropertySheetTemplateItem/portal_property_sheets/VifibSoftwareProductConstraint.xml
View file @
c40ffec6
...
...
@@ -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>
VifibSoftwareProductConstraint
</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>
...
...
@@ -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/VifibSoftwareProductConstraint/title_not_empty_constraint.xml
0 → 100644
View file @
c40ffec6
<?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>
title
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
title_not_empty_constraint
</string>
</value>
</item>
<item>
<key>
<string>
message_attribute_match
</string>
</key>
<value>
<string>
Title should be defined
</string>
</value>
</item>
<item>
<key>
<string>
message_no_such_property
</string>
</key>
<value>
<string>
Title should be defined
</string>
</value>
</item>
<item>
<key>
<string>
message_property_not_set
</string>
</key>
<value>
<string>
Title should 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/VifibSoftwareProductConstraint/title_unicity_constraint.xml
0 → 100644
View file @
c40ffec6
<?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>
title
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Title already exists
</string>
</value>
</item>
<item>
<key>
<string>
filter_parameter
</string>
</key>
<value>
<string>
python: {\'portal_type\': object.getPortalType(), \'title\': object.getTitle()}
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
title_unicity_constraint
</string>
</value>
</item>
<item>
<key>
<string>
message_invalid_attribute_unicity
</string>
</key>
<value>
<string>
Title already exists
</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
0 → 100644
View file @
c40ffec6
##############################################################################
#
# Copyright (c) 2002-2011 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
##############################################################################
from
VifibMixin
import
testVifibMixin
import
random
def
rndstr
():
return
str
(
random
.
random
())
def
getMessageList
(
o
):
return
[
str
(
q
.
getMessage
())
for
q
in
o
.
checkConsistency
()]
class
TestVifibSoftwareProductConstraint
(
testVifibMixin
):
def
getTitle
(
self
):
return
"Vifib Constraint checks"
def
test_title_not_empty
(
self
):
software_product
=
self
.
portal
.
software_product_module
.
newContent
(
portal_type
=
'Software Product'
)
consistency_message
=
'Title should be defined'
self
.
assertTrue
(
consistency_message
in
getMessageList
(
software_product
))
software_product
.
edit
(
title
=
rndstr
())
self
.
assertFalse
(
consistency_message
in
getMessageList
(
software_product
))
def
test_title_unique
(
self
):
title
=
rndstr
()
title_2
=
rndstr
()
consistency_message
=
'Title already exists'
software_product
=
self
.
portal
.
software_product_module
.
newContent
(
portal_type
=
'Software Product'
,
title
=
title
)
software_product_2
=
self
.
portal
.
software_product_module
.
newContent
(
portal_type
=
'Software Product'
,
title
=
title
)
self
.
stepTic
()
self
.
assertTrue
(
consistency_message
in
getMessageList
(
software_product
))
self
.
assertTrue
(
consistency_message
in
getMessageList
(
software_product_2
))
software_product_2
.
setTitle
(
title_2
)
self
.
stepTic
()
self
.
assertFalse
(
consistency_message
in
getMessageList
(
software_product
))
self
.
assertFalse
(
consistency_message
in
getMessageList
(
software_product_2
))
master/bt5/vifib_erp5/bt/revision
View file @
c40ffec6
189
\ No newline at end of file
190
\ No newline at end of file
master/bt5/vifib_erp5/bt/template_test_id_list
View file @
c40ffec6
...
...
@@ -5,3 +5,4 @@ testVifibUserCustomer
testVifibUserDeveloper
testVifibSlapgrid2
ViFiBOrderTest
testVifibConstraint
\ 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