Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
137
Merge Requests
137
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
d9eb2b26
Commit
d9eb2b26
authored
Oct 04, 2024
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "testAlarm: commit transaction after alarm.setNextAlarmDate()."
This reverts commit
e83a42ba
.
parent
bc14f4e7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
24 deletions
+0
-24
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testAlarm.py
...TestTemplateItem/portal_components/test.erp5.testAlarm.py
+0
-24
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testAlarm.py
View file @
d9eb2b26
...
...
@@ -79,7 +79,6 @@ class TestAlarm(AlarmTestCase):
alarm
.
setEnabled
(
True
)
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
date
)
alarm
.
setNextAlarmDate
(
current_date
=
now
)
# This should not do change the alarm date
self
.
commit
()
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
date
)
def
test_14_NewActiveProcess
(
self
):
...
...
@@ -385,7 +384,6 @@ class TestPeriodicity(AlarmTestCase):
for
date
in
args
[:
-
1
]:
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
date
)
alarm
.
setNextAlarmDate
(
current_date
=
date
)
self
.
commit
()
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
args
[
-
1
])
def
test_03_EveryHour
(
self
):
...
...
@@ -396,16 +394,13 @@ class TestPeriodicity(AlarmTestCase):
alarm
.
setPeriodicityHourFrequency
(
1
)
self
.
tic
()
alarm
.
setNextAlarmDate
(
current_date
=
now
)
self
.
commit
()
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
date
)
now
=
addToDate
(
now
,
day
=
2
)
alarm
.
setNextAlarmDate
(
current_date
=
now
)
self
.
commit
()
next_date
=
addToDate
(
date
,
hour
=
1
)
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
next_date
)
now
=
addToDate
(
now
,
hour
=
1
,
minute
=
5
)
alarm
.
setNextAlarmDate
(
current_date
=
now
)
self
.
commit
()
next_date
=
addToDate
(
next_date
,
hour
=
1
)
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
next_date
)
# check if manual invoking does not break getAlarmDate() result.
...
...
@@ -422,16 +417,13 @@ class TestPeriodicity(AlarmTestCase):
alarm
.
setPeriodicityHourFrequency
(
3
)
self
.
tic
()
alarm
.
setNextAlarmDate
(
current_date
=
now
)
self
.
commit
()
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
date
)
now
=
addToDate
(
now
,
day
=
2
)
alarm
.
setNextAlarmDate
(
current_date
=
now
)
self
.
commit
()
next_date
=
addToDate
(
date
,
hour
=
3
)
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
next_date
)
now
=
addToDate
(
now
,
hour
=
3
,
minute
=
7
,
second
=
4
)
alarm
.
setNextAlarmDate
(
current_date
=
now
)
self
.
commit
()
next_date
=
addToDate
(
next_date
,
hour
=
3
)
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
next_date
)
...
...
@@ -448,13 +440,10 @@ class TestPeriodicity(AlarmTestCase):
self
.
tic
()
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
right_first_date
)
alarm
.
setNextAlarmDate
(
current_date
=
right_first_date
)
self
.
commit
()
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
right_second_date
)
alarm
.
setNextAlarmDate
(
current_date
=
right_second_date
)
self
.
commit
()
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
right_third_date
)
alarm
.
setNextAlarmDate
(
current_date
=
right_third_date
)
self
.
commit
()
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
right_fourth_date
)
def
test_06_EveryDayOnce
(
self
):
...
...
@@ -469,10 +458,8 @@ class TestPeriodicity(AlarmTestCase):
self
.
tic
()
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
right_first_date
)
alarm
.
setNextAlarmDate
(
current_date
=
right_first_date
)
self
.
commit
()
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
right_second_date
)
alarm
.
setNextAlarmDate
(
current_date
=
right_second_date
)
self
.
commit
()
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
right_third_date
)
def
test_07_Every3DaysSomeHours
(
self
):
...
...
@@ -488,13 +475,10 @@ class TestPeriodicity(AlarmTestCase):
self
.
tic
()
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
right_first_date
)
alarm
.
setNextAlarmDate
(
current_date
=
right_first_date
)
self
.
commit
()
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
right_second_date
)
alarm
.
setNextAlarmDate
(
current_date
=
right_second_date
)
self
.
commit
()
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
right_third_date
)
alarm
.
setNextAlarmDate
(
current_date
=
right_third_date
)
self
.
commit
()
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
right_fourth_date
)
def
test_07a_Every4DaysSomeHours
(
self
):
...
...
@@ -511,16 +495,12 @@ class TestPeriodicity(AlarmTestCase):
self
.
tic
()
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
right_first_date
)
alarm
.
setNextAlarmDate
(
current_date
=
right_first_date
)
self
.
commit
()
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
right_second_date
)
alarm
.
setNextAlarmDate
(
current_date
=
right_second_date
)
self
.
commit
()
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
right_third_date
)
alarm
.
setNextAlarmDate
(
current_date
=
right_third_date
)
self
.
commit
()
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
right_fourth_date
)
alarm
.
setNextAlarmDate
(
current_date
=
right_fourth_date
)
self
.
commit
()
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
right_fifth_date
)
def
test_08_SomeWeekDaysSomeHours
(
self
):
...
...
@@ -594,16 +574,13 @@ class TestPeriodicity(AlarmTestCase):
alarm
.
setPeriodicityMinuteFrequency
(
5
)
self
.
tic
()
alarm
.
setNextAlarmDate
(
current_date
=
now
)
self
.
commit
()
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
date
)
now
=
addToDate
(
now
,
day
=
2
)
alarm
.
setNextAlarmDate
(
current_date
=
now
)
self
.
commit
()
next_date
=
addToDate
(
date
,
minute
=
5
)
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
next_date
)
now
=
addToDate
(
now
,
minute
=
5
,
second
=
14
)
alarm
.
setNextAlarmDate
(
current_date
=
now
)
self
.
commit
()
next_date
=
addToDate
(
next_date
,
minute
=
5
)
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
next_date
)
...
...
@@ -615,7 +592,6 @@ class TestPeriodicity(AlarmTestCase):
alarm
.
setPeriodicityMinuteFrequency
(
1
)
self
.
tic
()
alarm
.
setNextAlarmDate
(
current_date
=
date
)
self
.
commit
()
self
.
assertEqual
(
alarm
.
getAlarmDate
(),
date
)
def
test_week_day_item_list
(
self
):
...
...
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