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
18911fb0
Commit
18911fb0
authored
Feb 12, 2016
by
jitka
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4 from matejcik/cust_views
some dashboard tests
parents
44cbfbbf
9ab6340f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
1 deletion
+38
-1
weblate/trans/tests/test_views.py
weblate/trans/tests/test_views.py
+38
-1
No files found.
weblate/trans/tests/test_views.py
View file @
18911fb0
...
...
@@ -35,7 +35,8 @@ from django.core.urlresolvers import reverse
from
django.contrib.messages.storage.fallback
import
FallbackStorage
from
django.core
import
mail
from
weblate.trans.models
import
WhiteboardMessage
from
weblate.lang.models
import
Language
from
weblate.trans.models
import
ComponentList
,
WhiteboardMessage
from
weblate.trans.tests.test_models
import
RepoTestCase
from
weblate.accounts.models
import
Profile
...
...
@@ -399,6 +400,42 @@ class HomeViewTest(ViewTestCase):
response
=
self
.
client
.
get
(
reverse
(
'home'
))
self
.
assertNotContains
(
response
,
'whiteboard'
)
def
test_component_list
(
self
):
cl
=
ComponentList
(
name
=
"TestCL"
,
slug
=
"testcl"
)
cl
.
save
()
response
=
self
.
client
.
get
(
reverse
(
'home'
))
self
.
assertContains
(
response
,
'TestCL'
)
self
.
assertEquals
(
len
(
response
.
context
[
'componentlists'
]),
1
)
def
test_subscriptions
(
self
):
# no subscribed projects at first
response
=
self
.
client
.
get
(
reverse
(
'home'
))
self
.
assertFalse
(
len
(
response
.
context
[
'subscribed_projects'
]))
# subscribe a project
self
.
user
.
profile
.
subscriptions
.
add
(
self
.
project
)
response
=
self
.
client
.
get
(
reverse
(
'home'
))
self
.
assertEquals
(
len
(
response
.
context
[
'subscribed_projects'
]),
1
)
def
test_language_filters
(
self
):
# check language filters
response
=
self
.
client
.
get
(
reverse
(
'home'
))
self
.
assertFalse
(
response
.
context
[
'userlanguages'
])
self
.
assertFalse
(
response
.
context
[
'usersubscriptions'
])
# add a language
lang
=
Language
.
objects
.
get
(
code
=
'cs'
)
self
.
user
.
profile
.
languages
.
add
(
lang
)
response
=
self
.
client
.
get
(
reverse
(
'home'
))
self
.
assertEquals
(
len
(
response
.
context
[
'userlanguages'
]),
1
)
self
.
assertFalse
(
response
.
context
[
'usersubscriptions'
])
# add a subscription
self
.
user
.
profile
.
subscriptions
.
add
(
self
.
project
)
response
=
self
.
client
.
get
(
reverse
(
'home'
))
self
.
assertEquals
(
len
(
response
.
context
[
'usersubscriptions'
]),
1
)
class
SourceStringsTest
(
ViewTestCase
):
def
test_edit_priority
(
self
):
...
...
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