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
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
Carlos Ramos Carreño
erp5
Commits
704f4055
Commit
704f4055
authored
Jan 29, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accounting_l10n_fr py3
parent
6804fda8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
bt5/erp5_accounting_l10n_fr/TestTemplateItem/portal_components/test.erp5.testAccounting_l10n_fr.py
...tem/portal_components/test.erp5.testAccounting_l10n_fr.py
+15
-15
No files found.
bt5/erp5_accounting_l10n_fr/TestTemplateItem/portal_components/test.erp5.testAccounting_l10n_fr.py
View file @
704f4055
...
@@ -30,11 +30,11 @@
...
@@ -30,11 +30,11 @@
"""Test suite for erp5_accounting_l10n_fr
"""Test suite for erp5_accounting_l10n_fr
"""
"""
import
unittest
import
zipfile
import
email
import
email
import
io
import
os.path
import
os.path
from
six.moves
import
cStringIO
as
StringIO
import
unittest
import
zipfile
from
DateTime
import
DateTime
from
DateTime
import
DateTime
from
lxml
import
etree
from
lxml
import
etree
...
@@ -109,7 +109,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
...
@@ -109,7 +109,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
os
.
path
.
dirname
(
Products
.
ERP5
.
tests
.
__file__
),
os
.
path
.
dirname
(
Products
.
ERP5
.
tests
.
__file__
),
'test_data'
,
'test_data'
,
noNamespaceSchemaLocation
,
noNamespaceSchemaLocation
,
))
as
f
:
)
,
'rb'
)
as
f
:
xmlschema_doc
=
etree
.
parse
(
f
)
xmlschema_doc
=
etree
.
parse
(
f
)
xmlschema
=
etree
.
XMLSchema
(
xmlschema_doc
)
xmlschema
=
etree
.
XMLSchema
(
xmlschema_doc
)
...
@@ -121,14 +121,14 @@ class TestAccounting_l10n_fr(AccountingTestCase):
...
@@ -121,14 +121,14 @@ class TestAccounting_l10n_fr(AccountingTestCase):
self
.
assertNotEqual
((),
last_message
)
self
.
assertNotEqual
((),
last_message
)
_
,
mto
,
message_text
=
last_message
_
,
mto
,
message_text
=
last_message
self
.
assertEqual
(
'"%s" <%s>'
%
(
self
.
first_name
,
self
.
recipient_email_address
),
mto
[
0
])
self
.
assertEqual
(
'"%s" <%s>'
%
(
self
.
first_name
,
self
.
recipient_email_address
),
mto
[
0
])
mail_message
=
email
.
message_from_string
(
message_text
)
mail_message
=
email
.
message_from_string
(
message_text
.
decode
()
)
for
part
in
mail_message
.
walk
():
for
part
in
mail_message
.
walk
():
content_type
=
part
.
get_content_type
()
content_type
=
part
.
get_content_type
()
file_name
=
part
.
get_filename
()
file_name
=
part
.
get_filename
()
if
file_name
==
'FEC-20141231.zip'
:
if
file_name
==
'FEC-20141231.zip'
:
self
.
assertEqual
(
'application/zip'
,
content_type
)
self
.
assertEqual
(
'application/zip'
,
content_type
)
data
=
part
.
get_payload
(
decode
=
True
)
data
=
part
.
get_payload
(
decode
=
True
)
zf
=
zipfile
.
ZipFile
(
String
IO
(
data
))
zf
=
zipfile
.
ZipFile
(
io
.
Bytes
IO
(
data
))
self
.
assertIn
(
"12345689FEC20141231.xml"
,
zf
.
namelist
())
self
.
assertIn
(
"12345689FEC20141231.xml"
,
zf
.
namelist
())
return
zf
.
open
(
"12345689FEC20141231.xml"
).
read
()
return
zf
.
open
(
"12345689FEC20141231.xml"
).
read
()
self
.
fail
(
"Attachment not found"
)
self
.
fail
(
"Attachment not found"
)
...
@@ -253,7 +253,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
...
@@ -253,7 +253,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
self
.
assertEqual
(
1
,
len
(
journal_list
))
self
.
assertEqual
(
1
,
len
(
journal_list
))
journal
=
journal_list
[
0
]
journal
=
journal_list
[
0
]
ecriture_list
=
sorted
([
x
.
text
.
encode
(
'utf-8'
)
for
x
in
journal
.
xpath
(
".//EcritureLib"
)])
ecriture_list
=
sorted
([
x
.
text
for
x
in
journal
.
xpath
(
".//EcritureLib"
)])
self
.
assertEqual
([
'Premiere Ecriture'
],
ecriture_list
)
self
.
assertEqual
([
'Premiere Ecriture'
],
ecriture_list
)
debit_list
=
journal
.
xpath
(
".//Debit"
)
debit_list
=
journal
.
xpath
(
".//Debit"
)
...
@@ -269,7 +269,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
...
@@ -269,7 +269,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
self
.
assertEqual
(
1
,
len
(
journal_list
))
self
.
assertEqual
(
1
,
len
(
journal_list
))
journal
=
journal_list
[
0
]
journal
=
journal_list
[
0
]
ecriture_list
=
sorted
([
x
.
text
.
encode
(
'utf-8'
)
for
x
in
journal
.
xpath
(
".//EcritureLib"
)])
ecriture_list
=
sorted
([
x
.
text
for
x
in
journal
.
xpath
(
".//EcritureLib"
)])
self
.
assertEqual
([
'Seconde Ecriture'
],
ecriture_list
)
self
.
assertEqual
([
'Seconde Ecriture'
],
ecriture_list
)
debit_list
=
journal
.
xpath
(
".//Debit"
)
debit_list
=
journal
.
xpath
(
".//Debit"
)
...
@@ -289,7 +289,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
...
@@ -289,7 +289,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
self
.
assertEqual
(
1
,
len
(
journal_list
))
self
.
assertEqual
(
1
,
len
(
journal_list
))
journal
=
journal_list
[
0
]
journal
=
journal_list
[
0
]
ecriture_list
=
sorted
([
x
.
text
.
encode
(
'utf-8'
)
for
x
in
journal
.
xpath
(
".//EcritureLib"
)])
ecriture_list
=
sorted
([
x
.
text
for
x
in
journal
.
xpath
(
".//EcritureLib"
)])
self
.
assertEqual
([
'Premiere Ecriture'
],
ecriture_list
)
self
.
assertEqual
([
'Premiere Ecriture'
],
ecriture_list
)
debit_list
=
journal
.
xpath
(
".//Debit"
)
debit_list
=
journal
.
xpath
(
".//Debit"
)
...
@@ -305,7 +305,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
...
@@ -305,7 +305,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
self
.
assertEqual
(
1
,
len
(
journal_list
))
self
.
assertEqual
(
1
,
len
(
journal_list
))
journal
=
journal_list
[
0
]
journal
=
journal_list
[
0
]
ecriture_list
=
sorted
([
x
.
text
.
encode
(
'utf-8'
)
for
x
in
journal
.
xpath
(
".//EcritureLib"
)])
ecriture_list
=
sorted
([
x
.
text
for
x
in
journal
.
xpath
(
".//EcritureLib"
)])
self
.
assertEqual
([
'Seconde Ecriture'
,
'Troisieme Ecriture'
],
ecriture_list
)
self
.
assertEqual
([
'Seconde Ecriture'
,
'Troisieme Ecriture'
],
ecriture_list
)
debit_list
=
journal
.
xpath
(
".//Debit"
)
debit_list
=
journal
.
xpath
(
".//Debit"
)
...
@@ -324,7 +324,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
...
@@ -324,7 +324,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
self
.
assertEqual
(
1
,
len
(
journal_list
))
self
.
assertEqual
(
1
,
len
(
journal_list
))
journal
=
journal_list
[
0
]
journal
=
journal_list
[
0
]
ecriture_list
=
sorted
([
x
.
text
.
encode
(
'utf-8'
)
for
x
in
journal
.
xpath
(
".//EcritureLib"
)])
ecriture_list
=
sorted
([
x
.
text
for
x
in
journal
.
xpath
(
".//EcritureLib"
)])
self
.
assertEqual
([
'Premiere Ecriture'
,
'Seconde Ecriture'
],
ecriture_list
)
self
.
assertEqual
([
'Premiere Ecriture'
,
'Seconde Ecriture'
],
ecriture_list
)
debit_list
=
journal
.
xpath
(
".//Debit"
)
debit_list
=
journal
.
xpath
(
".//Debit"
)
...
@@ -340,7 +340,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
...
@@ -340,7 +340,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
self
.
assertEqual
(
1
,
len
(
journal_list
))
self
.
assertEqual
(
1
,
len
(
journal_list
))
journal
=
journal_list
[
0
]
journal
=
journal_list
[
0
]
ecriture_list
=
sorted
([
x
.
text
.
encode
(
'utf-8'
)
for
x
in
journal
.
xpath
(
".//EcritureLib"
)])
ecriture_list
=
sorted
([
x
.
text
for
x
in
journal
.
xpath
(
".//EcritureLib"
)])
self
.
assertEqual
([
'Troisieme Ecriture'
],
ecriture_list
)
self
.
assertEqual
([
'Troisieme Ecriture'
],
ecriture_list
)
debit_list
=
journal
.
xpath
(
".//Debit"
)
debit_list
=
journal
.
xpath
(
".//Debit"
)
...
@@ -359,7 +359,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
...
@@ -359,7 +359,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
self
.
assertEqual
(
1
,
len
(
journal_list
))
self
.
assertEqual
(
1
,
len
(
journal_list
))
journal
=
journal_list
[
0
]
journal
=
journal_list
[
0
]
ecriture_list
=
sorted
([
x
.
text
.
encode
(
'utf-8'
)
for
x
in
journal
.
xpath
(
".//EcritureLib"
)])
ecriture_list
=
sorted
([
x
.
text
for
x
in
journal
.
xpath
(
".//EcritureLib"
)])
self
.
assertEqual
([
'Premiere Ecriture'
],
ecriture_list
)
self
.
assertEqual
([
'Premiere Ecriture'
],
ecriture_list
)
debit_list
=
journal
.
xpath
(
".//Debit"
)
debit_list
=
journal
.
xpath
(
".//Debit"
)
...
@@ -375,7 +375,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
...
@@ -375,7 +375,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
self
.
assertEqual
(
1
,
len
(
journal_list
))
self
.
assertEqual
(
1
,
len
(
journal_list
))
journal
=
journal_list
[
0
]
journal
=
journal_list
[
0
]
ecriture_list
=
sorted
([
x
.
text
.
encode
(
'utf-8'
)
for
x
in
journal
.
xpath
(
".//EcritureLib"
)])
ecriture_list
=
sorted
([
x
.
text
for
x
in
journal
.
xpath
(
".//EcritureLib"
)])
self
.
assertEqual
([
'Seconde Ecriture'
],
ecriture_list
)
self
.
assertEqual
([
'Seconde Ecriture'
],
ecriture_list
)
debit_list
=
journal
.
xpath
(
".//Debit"
)
debit_list
=
journal
.
xpath
(
".//Debit"
)
...
@@ -391,7 +391,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
...
@@ -391,7 +391,7 @@ class TestAccounting_l10n_fr(AccountingTestCase):
self
.
assertEqual
(
1
,
len
(
journal_list
))
self
.
assertEqual
(
1
,
len
(
journal_list
))
journal
=
journal_list
[
0
]
journal
=
journal_list
[
0
]
ecriture_list
=
sorted
([
x
.
text
.
encode
(
'utf-8'
)
for
x
in
journal
.
xpath
(
".//EcritureLib"
)])
ecriture_list
=
sorted
([
x
.
text
for
x
in
journal
.
xpath
(
".//EcritureLib"
)])
self
.
assertEqual
([
'Troisieme Ecriture'
],
ecriture_list
)
self
.
assertEqual
([
'Troisieme Ecriture'
],
ecriture_list
)
debit_list
=
journal
.
xpath
(
".//Debit"
)
debit_list
=
journal
.
xpath
(
".//Debit"
)
...
...
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