allow the Mozilla Marketplace app to be called by a different name
This commit is contained in:
Родитель
bf6090c559
Коммит
467dff0c6a
|
@ -32,6 +32,9 @@ ABUSE_EMAIL = 'Mozilla Marketplace <marketplace-abuse@mozilla.org>'
|
||||||
NOBODY_EMAIL = 'Mozilla Marketplace <nobody@mozilla.org>'
|
NOBODY_EMAIL = 'Mozilla Marketplace <nobody@mozilla.org>'
|
||||||
DEFAULT_FROM_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'
|
ROOT_URLCONF = 'mkt.urls'
|
||||||
|
|
||||||
INSTALLED_APPS = list(INSTALLED_APPS)
|
INSTALLED_APPS = list(INSTALLED_APPS)
|
||||||
|
|
|
@ -56,6 +56,13 @@ class TestManifest(amo.tests.TestCase):
|
||||||
url = reverse('manifest.webapp')
|
url = reverse('manifest.webapp')
|
||||||
assert 'en-US' not in url and 'firefox' not in url
|
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):
|
class TestMozmarketJS(amo.tests.TestCase):
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
from django.conf import settings
|
||||||
from django.http import HttpResponse, HttpResponseForbidden
|
from django.http import HttpResponse, HttpResponseForbidden
|
||||||
from django.template import RequestContext
|
from django.template import RequestContext
|
||||||
from django.views.decorators.cache import cache_page
|
from django.views.decorators.cache import cache_page
|
||||||
|
@ -38,7 +39,8 @@ def csrf_failure(request, reason=''):
|
||||||
def manifest(request):
|
def manifest(request):
|
||||||
ctx = RequestContext(request)
|
ctx = RequestContext(request)
|
||||||
data = {
|
data = {
|
||||||
'name': 'Mozilla Marketplace',
|
'name': getattr(settings, 'WEBAPP_MANIFEST_NAME',
|
||||||
|
'Mozilla Marketplace'),
|
||||||
'description': 'The Mozilla Marketplace',
|
'description': 'The Mozilla Marketplace',
|
||||||
'developer': {
|
'developer': {
|
||||||
'name': 'Mozilla',
|
'name': 'Mozilla',
|
||||||
|
@ -83,7 +85,7 @@ def record(request):
|
||||||
# we can just turn the percentage down to zero.
|
# we can just turn the percentage down to zero.
|
||||||
if get_collect_timings():
|
if get_collect_timings():
|
||||||
return django_statsd_record(request)
|
return django_statsd_record(request)
|
||||||
return http.HttpResponseForbidden()
|
return HttpResponseForbidden()
|
||||||
|
|
||||||
|
|
||||||
# Cache this for an hour so that newly deployed changes are available within
|
# Cache this for an hour so that newly deployed changes are available within
|
||||||
|
|
Загрузка…
Ссылка в новой задаче