Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
d65d671b
Commit
d65d671b
authored
Aug 21, 2015
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add testcase for simple CSV import
Fixes #644 Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
ebd52da9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
weblate/trans/tests/data/cs.csv
weblate/trans/tests/data/cs.csv
+1
-0
weblate/trans/tests/test_files.py
weblate/trans/tests/test_files.py
+20
-0
No files found.
weblate/trans/tests/data/cs.csv
0 → 100644
View file @
d65d671b
Thank you for using Weblate.,Děkujeme za použití Weblate.
weblate/trans/tests/test_files.py
View file @
d65d671b
...
...
@@ -27,6 +27,7 @@ from django.core.urlresolvers import reverse
from
weblate.trans.tests.utils
import
get_test_file
TEST_PO
=
get_test_file
(
'cs.po'
)
TEST_CSV
=
get_test_file
(
'cs.csv'
)
TEST_PO_BOM
=
get_test_file
(
'cs-bom.po'
)
TEST_FUZZY_PO
=
get_test_file
(
'cs-fuzzy.po'
)
TEST_MO
=
get_test_file
(
'cs.mo'
)
...
...
@@ -288,6 +289,25 @@ class AndroidImportTest(ViewTestCase):
self
.
assertEqual
(
translation
.
total
,
4
)
class
CSVImportTest
(
ViewTestCase
):
def
test_import
(
self
):
translation
=
self
.
get_translation
()
self
.
assertEqual
(
translation
.
translated
,
0
)
self
.
assertEqual
(
translation
.
fuzzy
,
0
)
with
open
(
TEST_CSV
)
as
handle
:
self
.
client
.
post
(
reverse
(
'upload_translation'
,
kwargs
=
self
.
kw_translation
),
{
'file'
:
handle
}
)
# Verify stats
translation
=
self
.
get_translation
()
self
.
assertEqual
(
translation
.
translated
,
1
)
self
.
assertEqual
(
translation
.
fuzzy
,
0
)
class
ExportTest
(
ViewTestCase
):
'''
Testing of file export.
...
...
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