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
e166c6b8
Commit
e166c6b8
authored
Sep 30, 2022
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_rss_style: Add tests for SaleInvoiceTransaction_getRSS[Title|Description]
parent
9cb9ed03
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
4 deletions
+52
-4
master/bt5/slapos_rss_style/SkinTemplateItem/portal_skins/slapos_rss_style/SaleInvoiceTransaction_getRSSTitle.py
...ns/slapos_rss_style/SaleInvoiceTransaction_getRSSTitle.py
+8
-2
master/bt5/slapos_rss_style/TestTemplateItem/portal_components/test.erp5.testSlapOSRSSStyleSkins.py
...em/portal_components/test.erp5.testSlapOSRSSStyleSkins.py
+44
-2
No files found.
master/bt5/slapos_rss_style/SkinTemplateItem/portal_skins/slapos_rss_style/SaleInvoiceTransaction_getRSSTitle.py
View file @
e166c6b8
...
...
@@ -8,6 +8,12 @@ else:
prefix
+=
"%s"
%
context
.
Base_translateString
(
"Invoice"
)
return
"%s %s - (%s)"
%
(
prefix
,
start_date
=
context
.
getStartDate
()
if
start_date
is
not
None
:
start_date
=
' - (%s)'
%
context
.
getStartDate
().
strftime
(
"%d/%m/%Y"
)
else
:
start_date
=
''
return
"%s %s%s"
%
(
prefix
,
context
.
getReference
(),
context
.
getStartDate
().
strftime
(
"%d/%m/%Y"
)
)
start_date
)
master/bt5/slapos_rss_style/TestTemplateItem/portal_components/test.erp5.testSlapOSRSSStyleSkins.py
View file @
e166c6b8
...
...
@@ -1062,7 +1062,6 @@ class TestSlapOSBase_getEventList(TestRSSSyleSkinsMixin):
self
.
assertEqual
(
open_ticket_list
[
2
].
title
,
ticket
.
getTitle
())
class
TestBase_getTicketUrl
(
TestRSSSyleSkinsMixin
):
def
testBase_getTicketUrl
(
self
):
ticket
=
self
.
portal
.
support_request_module
.
newContent
(
\
...
...
@@ -1081,4 +1080,47 @@ class TestBase_getTicketUrl(TestRSSSyleSkinsMixin):
self
.
assertIn
(
"/#/%s"
%
ticket
.
getRelativeUrl
(),
web_site
.
support_request_module
[
ticket
.
getId
()].
Base_getTicketUrl
())
\ No newline at end of file
class
TestSlapOSSaleInvoiceTransaction_getRSSTitleAndDescription
(
TestRSSSyleSkinsMixin
):
def
test
(
self
):
invoice
=
self
.
portal
.
accounting_module
.
newContent
(
\
portal_type
=
"Sale Invoice Transaction"
,
reference
=
"TESTINVOICE-%s"
%
self
.
new_id
,
title
=
"Test Sale Invoice %s"
%
self
.
new_id
)
self
.
portal
.
portal_skins
.
changeSkin
(
'RSS'
)
text
=
self
.
portal
.
Base_translateString
(
"Invoice"
)
self
.
assertEqual
(
invoice
.
SaleInvoiceTransaction_getRSSTitle
(),
"%s %s"
%
(
text
,
invoice
.
getReference
()))
self
.
assertIn
(
invoice
.
Base_getTicketUrl
(),
invoice
.
SaleInvoiceTransaction_getRSSDescription
())
self
.
assertIn
(
invoice
.
getReference
(),
invoice
.
SaleInvoiceTransaction_getRSSDescription
())
invoice_via_website
=
\
self
.
portal
.
web_site_module
.
renderjs_runner
.
accounting_module
[
invoice
.
getId
()]
self
.
assertEqual
(
invoice_via_website
.
SaleInvoiceTransaction_getRSSTitle
(),
"[RenderJS Runner] %s %s"
%
(
text
,
invoice
.
getReference
()))
self
.
assertNotIn
(
invoice
.
Base_getTicketUrl
(),
invoice_via_website
.
SaleInvoiceTransaction_getRSSDescription
())
self
.
assertIn
(
invoice_via_website
.
Base_getTicketUrl
(),
invoice_via_website
.
SaleInvoiceTransaction_getRSSDescription
())
invoice
.
setStartDate
(
DateTime
(
"02/01/2018"
))
self
.
assertEqual
(
invoice_via_website
.
SaleInvoiceTransaction_getRSSTitle
(),
"[RenderJS Runner] %s %s - (01/02/2018)"
%
(
text
,
invoice
.
getReference
()))
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