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
7
Merge Requests
7
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
Jérome Perrin
erp5
Commits
a2e95580
Commit
a2e95580
authored
Apr 26, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core_test: minimal test for Base_generateBarcodeImage
parent
81c0dc80
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Base.py
...tTemplateItem/portal_components/test.erp5.testERP5Base.py
+23
-0
No files found.
bt5/erp5_core_test/TestTemplateItem/portal_components/test.erp5.testERP5Base.py
View file @
a2e95580
...
...
@@ -2178,3 +2178,26 @@ class TestImage(ERP5TypeTestCase):
content_type
,
(
filename
,
image
.
getContentType
(),
content_type
))
self
.
portal
.
manage_delObjects
([
self
.
id
()])
class
Base_generateBarcodeImageTest
(
ERP5TypeTestCase
):
def
test_datamatrix_png
(
self
):
png
=
self
.
portal
.
Base_generateBarcodeImage
(
barcode_type
=
'datamatrix'
,
data
=
b'test'
)
self
.
assertTrue
(
png
.
startswith
(
b'
\
x89
PNG'
),
png
)
def
test_ean13_png
(
self
):
png
=
self
.
portal
.
Base_generateBarcodeImage
(
barcode_type
=
'ean13'
,
data
=
b'0799439112766'
)
self
.
assertTrue
(
png
.
startswith
(
b'
\
x89
PNG'
),
png
)
def
test_code128_png
(
self
):
png
=
self
.
portal
.
Base_generateBarcodeImage
(
barcode_type
=
'code128'
,
data
=
b'123'
)
self
.
assertTrue
(
png
.
startswith
(
b'
\
x89
PNG'
),
png
)
def
test_qrcode_png
(
self
):
png
=
self
.
portal
.
Base_generateBarcodeImage
(
barcode_type
=
'qrcode'
,
data
=
b'test'
)
self
.
assertTrue
(
png
.
startswith
(
b'
\
x89
PNG'
),
png
)
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