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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
196e4c0f
Commit
196e4c0f
authored
Nov 30, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stabilise test code.
Thanks to mocking up getCreationDate it is possible to check exact scenarios.
parent
586fddf6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingInteractionWorkflow.py
...stTemplateItem/testSlapOSAccountingInteractionWorkflow.py
+14
-7
master/bt5/slapos_accounting/bt/revision
master/bt5/slapos_accounting/bt/revision
+1
-1
No files found.
master/bt5/slapos_accounting/TestTemplateItem/testSlapOSAccountingInteractionWorkflow.py
View file @
196e4c0f
...
...
@@ -3,6 +3,7 @@ from Products.SlapOS.tests.testSlapOSMixin import \
testSlapOSMixin
import
transaction
from
Products.ERP5Type.tests.utils
import
createZODBPythonScript
from
DateTime
import
DateTime
class
TestSlapOSAccountingInteractionWorkflow
(
testSlapOSMixin
):
def
beforeTearDown
(
self
):
...
...
@@ -138,7 +139,8 @@ class TestSlapOSAccountingInteractionWorkflow(testSlapOSMixin):
instance
.
requestStop
(
**
request_kw
)
self
.
assertEqual
(
instance
.
getCausalityState
(),
'diverged'
)
def
test_HostingSubscription_fixConsistency
(
self
):
def
test_HostingSubscription_fixConsistency
(
self
,
date
=
DateTime
(
'2012/01/15'
),
day
=
15
):
new_id
=
self
.
generateNewId
()
item
=
self
.
portal
.
hosting_subscription_module
.
newContent
(
portal_type
=
'Hosting Subscription'
,
...
...
@@ -153,18 +155,23 @@ class TestSlapOSAccountingInteractionWorkflow(testSlapOSMixin):
self
.
assertEqual
(
item
.
getPeriodicityMinute
(),
None
)
self
.
assertEqual
(
item
.
getPeriodicityMonthDay
(),
None
)
item
.
fixConsistency
()
try
:
from
Products.ERP5Type.Base
import
Base
Base
.
original_getCreationDate
=
Base
.
getCreationDate
def
getCreationDate
(
*
args
,
**
kwargs
):
return
date
Base
.
getCreationDate
=
getCreationDate
item
.
fixConsistency
()
finally
:
Base
.
getCreationDate
=
Base
.
original_getCreationDate
delattr
(
Base
,
'original_getCreationDate'
)
import
datetime
self
.
assertEqual
(
item
.
getPeriodicityHourList
(),
[
0
])
self
.
assertEqual
(
item
.
getPeriodicityMinuteList
(),
[
0
])
day
=
datetime
.
datetime
.
today
().
day
if
day
>
28
:
day
=
28
self
.
assertEqual
(
item
.
getPeriodicityMonthDay
(),
day
)
def
test_HostingSubscription_fixConsistency_today_after_28
(
self
):
raise
NotImplementedError
(
'Test missing.'
)
self
.
test_HostingSubscription_fixConsistency
(
DateTime
(
'2012/01/30'
),
28
)
def
test_HostingSubscription_manageAfter
(
self
):
class
DummyTestException
(
Exception
):
...
...
master/bt5/slapos_accounting/bt/revision
View file @
196e4c0f
188
\ No newline at end of file
189
\ 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