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
Labels
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Rafael Monnerat
slapos.core
Commits
5b71d0ff
Commit
5b71d0ff
authored
Sep 06, 2024
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: Add tests for accountant related constraint
parent
933706e5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudConstraint.py
.../portal_components/test.erp5.testSlapOSCloudConstraint.py
+29
-0
No files found.
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudConstraint.py
View file @
5b71d0ff
...
@@ -511,6 +511,35 @@ class TestSlapOSAssignmentConstraint(TestSlapOSConstraintMixin):
...
@@ -511,6 +511,35 @@ class TestSlapOSAssignmentConstraint(TestSlapOSConstraintMixin):
self
.
assertNotIn
(
consistency_message
,
self
.
getMessageList
(
assignment
))
self
.
assertNotIn
(
consistency_message
,
self
.
getMessageList
(
assignment
))
def
test_group_for_accountant_manager
(
self
):
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
)
person
.
validate
()
assignment
=
person
.
newContent
(
portal_type
=
'Assignment'
,
function
=
"accounting/manager"
)
consistency_message
=
'One group must be set when function is accountant '
\
'manager or agent'
self
.
assertIn
(
consistency_message
,
self
.
getMessageList
(
assignment
))
assignment
.
edit
(
group
=
'company'
)
self
.
assertNotIn
(
consistency_message
,
self
.
getMessageList
(
assignment
))
def
test_group_for_accountant_agent
(
self
):
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
)
person
.
validate
()
assignment
=
person
.
newContent
(
portal_type
=
'Assignment'
,
function
=
"accounting/agent"
)
consistency_message
=
'One group must be set when function is accountant '
\
'manager or agent'
self
.
assertIn
(
consistency_message
,
self
.
getMessageList
(
assignment
))
assignment
.
edit
(
group
=
'company'
)
self
.
assertNotIn
(
consistency_message
,
self
.
getMessageList
(
assignment
))
class
TestSlapOSEmailConstraint
(
TestSlapOSConstraintMixin
):
class
TestSlapOSEmailConstraint
(
TestSlapOSConstraintMixin
):
def
test_url_string_not_empty
(
self
):
def
test_url_string_not_empty
(
self
):
email
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
email
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
...
...
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