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
Gabriel Monnerat
slapos.core
Commits
6a3f732b
Commit
6a3f732b
authored
Nov 06, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move constraint to proper test.
parent
e609084b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
43 deletions
+42
-43
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreConstraint.py
...slapos_cloud/TestTemplateItem/testSlapOSCoreConstraint.py
+40
-0
master/bt5/slapos_cloud/bt/revision
master/bt5/slapos_cloud/bt/revision
+1
-1
master/bt5/vifib_erp5/TestTemplateItem/testVifibConstraint.py
...er/bt5/vifib_erp5/TestTemplateItem/testVifibConstraint.py
+0
-41
master/bt5/vifib_erp5/bt/revision
master/bt5/vifib_erp5/bt/revision
+1
-1
No files found.
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSCoreConstraint.py
View file @
6a3f732b
...
@@ -445,3 +445,43 @@ class TestSlapOSHostingSubscriptionConstraint(TestSlapOSConstraintMixin):
...
@@ -445,3 +445,43 @@ class TestSlapOSHostingSubscriptionConstraint(TestSlapOSConstraintMixin):
software_instance3
.
getRelativeUrl
()])
software_instance3
.
getRelativeUrl
()])
self
.
assertFalse
(
consistency_message
in
getMessageList
(
self
.
software_instance
))
self
.
assertFalse
(
consistency_message
in
getMessageList
(
self
.
software_instance
))
self
.
assertSameSet
(
current_message_list
,
getMessageList
(
self
.
software_instance
))
self
.
assertSameSet
(
current_message_list
,
getMessageList
(
self
.
software_instance
))
class
TestSlapOSPersonConstraint
(
testSlapOSMixin
):
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/slapos_cloud/bt/revision
View file @
6a3f732b
217
218
\ No newline at end of file
\ No newline at end of file
master/bt5/vifib_erp5/TestTemplateItem/testVifibConstraint.py
View file @
6a3f732b
...
@@ -267,47 +267,6 @@ class TestVifibInternalPackingListLineConstraint(testVifibMixin):
...
@@ -267,47 +267,6 @@ class TestVifibInternalPackingListLineConstraint(testVifibMixin):
self
.
assertFalse
(
consistency_message
in
getMessageList
(
line
))
self
.
assertFalse
(
consistency_message
in
getMessageList
(
line
))
class
TestVifibPersonConstraint
(
testVifibMixin
):
def
getTitle
(
self
):
return
"Vifib Person Constraint checks"
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
))
class
TestVifibPurchasePackingListConstraint
(
testVifibMixin
):
class
TestVifibPurchasePackingListConstraint
(
testVifibMixin
):
def
getTitle
(
self
):
def
getTitle
(
self
):
...
...
master/bt5/vifib_erp5/bt/revision
View file @
6a3f732b
548
549
\ No newline at end of file
\ 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