Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odoo CE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Comunitats Energètiques
Odoo CE
Commits
a77c2d0d
Commit
a77c2d0d
authored
1 year ago
by
ebuzeyTra
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Python test cases added"
This reverts commit
4ceb6225
.
parent
4ceb6225
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!195
[REL] 14.0.2.0.0
,
!185
constrain added and unlink method extended
Pipeline
#42197
passed
1 year ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
energy_project/tests/__init__.py
+0
-1
0 additions, 1 deletion
energy_project/tests/__init__.py
energy_project/tests/test_inscription_unlink.py
+0
-50
0 additions, 50 deletions
energy_project/tests/test_inscription_unlink.py
with
0 additions
and
51 deletions
energy_project/tests/__init__.py
deleted
100644 → 0
+
0
−
1
View file @
4ceb6225
from
.
import
test_inscription_unlink
This diff is collapsed.
Click to expand it.
energy_project/tests/test_inscription_unlink.py
deleted
100644 → 0
+
0
−
50
View file @
4ceb6225
from
odoo.tests.common
import
TransactionCase
from
odoo.exceptions
import
ValidationError
import
logging
log
=
logging
.
getLogger
(
__name__
)
class
TestInscriptionUnlink
(
TransactionCase
):
tags
=
[
'
energy_project
'
]
def
setUp
(
self
):
super
(
TestInscriptionUnlink
,
self
).
setUp
()
self
.
company
=
self
.
env
[
'
res.company
'
].
create
({
'
name
'
:
'
Company
'
})
self
.
project
=
self
.
env
[
'
energy_project.project
'
].
create
({
'
name
'
:
'
Project
'
})
self
.
partner
=
self
.
env
[
'
res.partner
'
].
create
({
'
name
'
:
'
Partner
'
})
self
.
inscription
=
self
.
env
[
'
energy_project.inscription
'
].
create
({
'
company_id
'
:
self
.
company
.
id
,
'
project_id
'
:
self
.
project
.
id
,
'
partner_id
'
:
self
.
partner
.
id
,
'
effective_date
'
:
'
2023-08-15
'
,
})
def
test_unlink_no_matching_assignations
(
self
):
log
.
info
(
'
Test 1: No matching assignations
'
)
self
.
inscription
.
unlink
()
self
.
assertFalse
(
self
.
inscription
.
exists
())
def
test_unlink_with_matching_assignations
(
self
):
log
.
info
(
'
Test 2: Matching assignations for the inscription
'
)
assignation
=
self
.
env
[
'
energy_selfconsumption.supply_point_assignation
'
].
create
({
'
distribution_table_id
'
:
self
.
project
.
selfconsumption_id
.
distribution_tables_ids
[
0
].
id
,
'
selfconsumption_project_id
'
:
self
.
project
.
id
,
'
supply_point_id
'
:
self
.
partner
.
id
,
})
with
self
.
assertRaises
(
ValidationError
):
self
.
inscription
.
unlink
()
def
test_unlink_with_matching_assignations_to_remove
(
self
):
log
.
info
(
'
Test 3: Matching assignations for removal
'
)
assignation
=
self
.
env
[
'
energy_selfconsumption.supply_point_assignation
'
].
create
({
'
distribution_table_id
'
:
self
.
project
.
selfconsumption_id
.
distribution_tables_ids
[
0
].
id
,
'
selfconsumption_project_id
'
:
self
.
project
.
id
,
'
supply_point_id
'
:
self
.
partner
.
id
,
})
self
.
inscription
.
unlink
()
self
.
assertFalse
(
self
.
inscription
.
exists
())
self
.
assertFalse
(
assignation
.
exists
())
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment