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
f1d87860
Commit
f1d87860
authored
Feb 19, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Complete testing of dictionary editing workflow
parent
ada8492d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
2 deletions
+29
-2
weblate/trans/tests/test_dictionary.py
weblate/trans/tests/test_dictionary.py
+29
-2
No files found.
weblate/trans/tests/test_dictionary.py
View file @
f1d87860
...
...
@@ -77,11 +77,13 @@ class DictionaryTest(ViewTestCase):
response
=
self
.
client
.
get
(
show_url
)
self
.
assertContains
(
response
,
u'podpůrná vrstva'
)
def
test_
add
(
self
):
def
test_
edit
(
self
):
'''
Test for manually adding words to glossary.
'''
show_url
=
self
.
get_url
(
'show_dictionary'
)
edit_url
=
self
.
get_url
(
'edit_dictionary'
)
delete_url
=
self
.
get_url
(
'delete_dictionary'
)
# Add word
response
=
self
.
client
.
post
(
...
...
@@ -92,13 +94,38 @@ class DictionaryTest(ViewTestCase):
# Check correct response
self
.
assertRedirects
(
response
,
show_url
)
# Check number of
imported
objects
# Check number of objects
self
.
assertEquals
(
Dictionary
.
objects
.
count
(),
1
)
dict_id
=
Dictionary
.
objects
.
all
()[
0
].
id
dict_id_url
=
'?id=%d'
%
dict_id
# Check they are shown
response
=
self
.
client
.
get
(
show_url
)
self
.
assertContains
(
response
,
u'překlad'
)
# Edit page
response
=
self
.
client
.
get
(
edit_url
+
dict_id_url
)
self
.
assertContains
(
response
,
u'překlad'
)
# Edit translation
response
=
self
.
client
.
post
(
edit_url
+
dict_id_url
,
{
'source'
:
'src'
,
'target'
:
u'přkld'
}
)
self
.
assertRedirects
(
response
,
show_url
)
# Check they are shown
response
=
self
.
client
.
get
(
show_url
)
self
.
assertContains
(
response
,
u'přkld'
)
# Test deleting
response
=
self
.
client
.
post
(
delete_url
,
{
'id'
:
dict_id
})
self
.
assertRedirects
(
response
,
show_url
)
# Check number of objects
self
.
assertEquals
(
Dictionary
.
objects
.
count
(),
0
)
def
test_download
(
self
):
'''
Test for downloading files.
...
...
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