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
641ac27d
Commit
641ac27d
authored
Feb 15, 2016
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test for disappeared message
Signed-off-by:
Michal Čihař
<
michal@cihar.com
>
parent
6a8ab796
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
3 deletions
+52
-3
weblate/trans/formats.py
weblate/trans/formats.py
+1
-3
weblate/trans/tests/test_subproject.py
weblate/trans/tests/test_subproject.py
+51
-0
No files found.
weblate/trans/formats.py
View file @
641ac27d
...
...
@@ -532,9 +532,7 @@ class FileFormat(object):
if
ttkit_unit
is
None
:
ttkit_unit
=
template_ttkit_unit
if
template_ttkit_unit
is
None
:
raise
Exception
(
'Could not find template unit for new unit!'
)
return
(
None
,
False
)
add
=
True
else
:
add
=
False
...
...
weblate/trans/tests/test_subproject.py
View file @
641ac27d
...
...
@@ -33,6 +33,7 @@ from weblate.trans.models import (
)
from
weblate.trans.tests
import
OverrideSettings
from
weblate.trans.tests.test_models
import
RepoTestCase
from
weblate.trans.tests.test_views
import
ViewTestCase
class
SubProjectTest
(
RepoTestCase
):
...
...
@@ -602,3 +603,53 @@ class SubProjectErrorTest(RepoTestCase):
ParseError
,
lambda
:
self
.
component
.
template_store
)
class
SubProjectEditTest
(
ViewTestCase
):
"""Tests for error handling"""
def
remove_units
(
self
,
store
):
if
store
is
not
None
:
store
.
units
=
[]
store
.
save
()
def
test_unit_disappear
(
self
):
translation
=
self
.
subproject
.
translation_set
.
get
(
language_code
=
'cs'
)
self
.
remove_units
(
self
.
subproject
.
template_store
)
self
.
remove_units
(
translation
.
store
.
store
)
# Clean class cache, pylint: disable=W0212
self
.
subproject
.
_template_store
=
None
translation
.
_store
=
None
unit
=
translation
.
unit_set
.
all
()[
0
]
request
=
self
.
get_request
(
'/'
)
self
.
assertFalse
(
unit
.
translate
(
request
,
[
'Empty'
],
False
)
)
class
SubProjectEditMonoTest
(
SubProjectEditTest
):
"""Tests for error handling"""
def
create_subproject
(
self
):
return
self
.
create_ts_mono
()
def
remove_units
(
self
,
store
):
store
.
parse
(
store
.
XMLskeleton
.
replace
(
"
\
n
"
,
""
).
encode
(
'utf-8'
))
store
.
save
()
def
test_unit_add
(
self
):
translation
=
self
.
subproject
.
translation_set
.
get
(
language_code
=
'cs'
)
self
.
remove_units
(
translation
.
store
.
store
)
# Clean class cache, pylint: disable=W0212
translation
.
_store
=
None
unit
=
translation
.
unit_set
.
all
()[
0
]
request
=
self
.
get_request
(
'/'
)
self
.
assertTrue
(
unit
.
translate
(
request
,
[
'Empty'
],
False
)
)
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