Skip to content

Commit

Permalink
fixes bug 1058283 - Make a contribute.json endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbe committed Aug 28, 2014
1 parent deb2fc9 commit 0678d80
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
32 changes: 32 additions & 0 deletions contribute.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "Socorro",
"description": "Socorro is a server to accept and process Breakpad crash reports from Firefox, Thunderbird, etc.",
"repository": {
"url": "https://github.com/mozilla/socorro",
"license": "MPL2",
"tests": "https://travis-ci.org/mozilla/socorro"
},
"participate": {
"home": "https://wiki.mozilla.org/Socorro",
"docs": "http://socorro.readthedocs.org/",
"irc": "irc://irc.mozilla.org/#breakpad",
"mailing-list": "https://www.mozilla.org/en-US/about/forums/#tools-socorro"
},
"bugs": {
"list": "https://bugzilla.mozilla.org/buglist.cgi?resolution=---&query_format=advanced&product=Socorro",
"report": "https://bugzilla.mozilla.org/enter_bug.cgi?product=Socorro"
},
"urls": {
"prod": "https://crash-stats.mozilla.com/",
"stage": "https://crash-stats.allizom.org/"
},
"keywords": [
"django",
"jquery",
"postgresql",
"elasticsearch",
"rabbitmq",
"python",
"css"
]
}
7 changes: 7 additions & 0 deletions webapp-django/crashstats/crashstats/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,13 @@ def mocked_get(url, params, **options):

class TestViews(BaseTestViews):

def test_contribute_json(self):
response = self.client.get('/contribute.json')
eq_(response.status_code, 200)
# should be valid JSON
ok_(json.loads(response.content))
eq_(response['Content-Type'], 'application/json')

@mock.patch('requests.get')
def test_handler500(self, rget):
root_urlconf = __import__(
Expand Down
4 changes: 4 additions & 0 deletions webapp-django/crashstats/urls.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import os

from django.conf import settings
from django.conf.urls import patterns, include
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
Expand All @@ -15,6 +17,8 @@

urlpatterns = patterns(
'',
(r'^(?P<path>contribute\.json)$', 'django.views.static.serve',
{'document_root': os.path.join(settings.ROOT, '..')}),
(r'', include(urls, namespace='crashstats')),
(r'', include(supersearch_urls)),
(r'^signature/', include(
Expand Down

0 comments on commit 0678d80

Please sign in to comment.