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
3855cf92
Commit
3855cf92
authored
Feb 15, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add notification hooks tests
parent
b1cd57ef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
4 deletions
+51
-4
weblate/trans/tests/__init__.py
weblate/trans/tests/__init__.py
+1
-0
weblate/trans/tests/test_hooks.py
weblate/trans/tests/test_hooks.py
+46
-0
weblate/urls.py
weblate/urls.py
+4
-4
No files found.
weblate/trans/tests/__init__.py
View file @
3855cf92
...
...
@@ -30,3 +30,4 @@ from weblate.trans.tests.test_models import *
from
weblate.trans.tests.test_views
import
*
from
weblate.trans.tests.test_commands
import
*
from
weblate.trans.tests.test_exports
import
*
from
weblate.trans.tests.test_hooks
import
*
weblate/trans/tests/test_hooks.py
0 → 100644
View file @
3855cf92
# -*- coding: utf-8 -*-
#
# Copyright © 2012 - 2013 Michal Čihař <michal@cihar.com>
#
# This file is part of Weblate <http://weblate.org/>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
"""
Tests for notification hooks.
"""
from
django.core.urlresolvers
import
reverse
from
django.utils
import
simplejson
from
weblate.trans.tests.test_views
import
ViewTestCase
class
HooksViewTest
(
ViewTestCase
):
def
test_view_hook_project
(
self
):
response
=
self
.
client
.
get
(
reverse
(
'hook-project'
,
kwargs
=
{
'project'
:
self
.
subproject
.
project
.
slug
})
)
self
.
assertContains
(
response
,
'update triggered'
)
def
test_view_hook_subproject
(
self
):
response
=
self
.
client
.
get
(
reverse
(
'hook-subproject'
,
kwargs
=
{
'project'
:
self
.
subproject
.
project
.
slug
,
'subproject'
:
self
.
subproject
.
slug
,
})
)
self
.
assertContains
(
response
,
'update triggered'
)
weblate/urls.py
View file @
3855cf92
...
...
@@ -180,10 +180,10 @@ urlpatterns = patterns('',
url
(
r'^checks/(?P<name>[^/]*)/(?P<project>[^/]*)/$'
,
'weblate.trans.views.show_check_project'
),
url
(
r'^checks/(?P<name>[^/]*)/(?P<project>[^/]*)/(?P<subproject>[^/]*)/$'
,
'weblate.trans.views.show_check_subproject'
),
url
(
r'^hooks/update/(?P<project>[^/]*)/(?P<subproject>[^/]*)/$'
,
'weblate.trans.api.update_subproject'
),
url
(
r'^hooks/update/(?P<project>[^/]*)/$'
,
'weblate.trans.api.update_project'
),
url
(
r'^hooks/github/$'
,
'weblate.trans.api.git_service_hook'
,
{
'service'
:
'github'
}),
url
(
r'^hooks/bitbucket/$'
,
'weblate.trans.api.git_service_hook'
,
{
'service'
:
'bitbucket'
}),
url
(
r'^hooks/update/(?P<project>[^/]*)/(?P<subproject>[^/]*)/$'
,
'weblate.trans.api.update_subproject'
,
name
=
'hook-subproject'
),
url
(
r'^hooks/update/(?P<project>[^/]*)/$'
,
'weblate.trans.api.update_project'
,
name
=
'hook-project'
),
url
(
r'^hooks/github/$'
,
'weblate.trans.api.git_service_hook'
,
{
'service'
:
'github'
}
,
name
=
'hook-github'
),
url
(
r'^hooks/bitbucket/$'
,
'weblate.trans.api.git_service_hook'
,
{
'service'
:
'bitbucket'
}
,
name
=
'hook-bitbucket'
),
url
(
r'^exports/stats/(?P<project>[^/]*)/(?P<subproject>[^/]*)/$'
,
'weblate.trans.api.export_stats'
,
name
=
'export-stats'
),
...
...
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