allow the Mozilla Marketplace app to be called by a different name

This commit is contained in:
Chris Van 2012-05-29 10:36:44 -07:00
Родитель bf6090c559
Коммит 467dff0c6a
3 изменённых файлов: 14 добавлений и 2 удалений

Просмотреть файл

@ -32,6 +32,9 @@ ABUSE_EMAIL = 'Mozilla Marketplace <marketplace-abuse@mozilla.org>'
NOBODY_EMAIL = 'Mozilla Marketplace <nobody@mozilla.org>'
DEFAULT_FROM_EMAIL = 'Mozilla Marketplace <nobody@mozilla.org>'
# Default app name for our webapp as specified in `manifest.webapp`.
WEBAPP_MANIFEST_NAME = 'Mozilla Marketplace'
ROOT_URLCONF = 'mkt.urls'
INSTALLED_APPS = list(INSTALLED_APPS)

Просмотреть файл

@ -56,6 +56,13 @@ class TestManifest(amo.tests.TestCase):
url = reverse('manifest.webapp')
assert 'en-US' not in url and 'firefox' not in url
@mock.patch.object(settings, 'WEBAPP_MANIFEST_NAME', 'Mozilla Fruitstand')
def test_manifest_name(self):
response = self.client.get(reverse('manifest.webapp'))
eq_(response.status_code, 200)
content = json.loads(response.content)
eq_(content['name'], 'Mozilla Fruitstand')
class TestMozmarketJS(amo.tests.TestCase):

Просмотреть файл

@ -1,5 +1,6 @@
import json
from django.conf import settings
from django.http import HttpResponse, HttpResponseForbidden
from django.template import RequestContext
from django.views.decorators.cache import cache_page
@ -38,7 +39,8 @@ def csrf_failure(request, reason=''):
def manifest(request):
ctx = RequestContext(request)
data = {
'name': 'Mozilla Marketplace',
'name': getattr(settings, 'WEBAPP_MANIFEST_NAME',
'Mozilla Marketplace'),
'description': 'The Mozilla Marketplace',
'developer': {
'name': 'Mozilla',
@ -83,7 +85,7 @@ def record(request):
# we can just turn the percentage down to zero.
if get_collect_timings():
return django_statsd_record(request)
return http.HttpResponseForbidden()
return HttpResponseForbidden()
# Cache this for an hour so that newly deployed changes are available within