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
Léo-Paul Géneau
slapos.core
Commits
10597281
Commit
10597281
authored
Nov 13, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Assert stop_date in each case.
parent
f3753a76
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
16 deletions
+19
-16
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingSlapOSRequestUpdateHostingSubscriptionOpenSaleOrderAlarm.py
...apOSRequestUpdateHostingSubscriptionOpenSaleOrderAlarm.py
+18
-15
master/bt5/slapos_accounting/bt/revision
master/bt5/slapos_accounting/bt/revision
+1
-1
No files found.
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingSlapOSRequestUpdateHostingSubscriptionOpenSaleOrderAlarm.py
View file @
10597281
...
...
@@ -288,6 +288,14 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
self
.
assertEqual
(
1
,
len
(
open_sale_order_line_list
))
line
=
open_sale_order_line_list
[
0
].
getObject
()
# calculate stop date to be after now, begin with start date with precision
# of month
stop_date
=
request_time
now
=
DateTime
()
while
stop_date
<
now
:
stop_date
=
addToDate
(
stop_date
,
to_add
=
{
'month'
:
1
})
self
.
assertEqual
(
stop_date
,
line
.
getStopDate
())
self
.
assertEqual
(
subscription
.
getRelativeUrl
(),
line
.
getAggregate
())
open_sale_order_line_template
=
self
.
portal
.
restrictedTraverse
(
self
.
portal
.
portal_preferences
.
getPreferredOpenSaleOrderLineTemplate
())
...
...
@@ -300,6 +308,7 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
self
.
assertEqual
(
open_sale_order_line_template
.
getPrice
(),
line
.
getPrice
())
self
.
assertEqual
(
request_time
,
line
.
getStartDate
())
self
.
assertEqual
(
stop_date
,
line
.
getStopDate
())
destroy_time
=
DateTime
(
'2012/02/01'
)
subscription
.
workflow_history
[
'instance_slap_interface_workflow'
].
append
({
...
...
@@ -355,14 +364,7 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
self
.
assertEqual
(
open_sale_order_line_template
.
getPrice
(),
line
.
getPrice
())
self
.
assertEqual
(
request_time
,
archived_line
.
getStartDate
())
# calculate stop date to be after now, begin with start date with precision
# of month
stop_date
=
request_time
now
=
DateTime
()
while
stop_date
<
now
:
stop_date
=
addToDate
(
stop_date
,
to_add
=
{
'month'
:
1
})
self
.
assertEqual
(
stop_date
,
archived_line
.
getStopDate
())
self
.
assertEqual
(
stop_date
,
line
.
getStopDate
())
def
test_lateAnalysed_HostingSubscription
(
self
):
person
=
self
.
portal
.
person_module
.
template_member
\
...
...
@@ -486,6 +488,14 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
line
.
getPrice
())
self
.
assertEqual
(
request_time
,
line
.
getStartDate
())
# calculate stop date to be after now, begin with start date with precision
# of month
stop_date
=
request_time
now
=
DateTime
()
while
stop_date
<
now
:
stop_date
=
addToDate
(
stop_date
,
to_add
=
{
'month'
:
1
})
self
.
assertEqual
(
stop_date
,
line
.
getStopDate
())
subscription2
=
self
.
portal
.
hosting_subscription_module
\
.
template_hosting_subscription
.
Base_createCloneDocument
(
batch_mode
=
1
)
subscription2
.
edit
(
reference
=
'TESTHS-%s'
%
self
.
generateNewId
(),
...
...
@@ -547,13 +557,6 @@ class TestHostingSubscription_requestUpdateOpenSaleOrder(testSlapOSMixin):
self
.
assertEqual
(
open_sale_order_line_template
.
getPrice
(),
line
.
getPrice
())
self
.
assertEqual
(
request_time
,
archived_line
.
getStartDate
())
# calculate stop date to be after now, begin with start date with precision
# of month
stop_date
=
request_time
now
=
DateTime
()
while
stop_date
<
now
:
stop_date
=
addToDate
(
stop_date
,
to_add
=
{
'month'
:
1
})
self
.
assertEqual
(
stop_date
,
archived_line
.
getStopDate
())
stop_date_2
=
request_time_2
...
...
master/bt5/slapos_accounting/bt/revision
View file @
10597281
19
\ No newline at end of file
20
\ 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