store the manifest_url if we have a webapp (bug 676119)
This commit is contained in:
Родитель
40a29e33aa
Коммит
225d6932b2
|
@ -355,6 +355,8 @@ class Addon(amo.models.OnChangeMixin, amo.models.ModelBase):
|
|||
addon = Addon(**dict((k, v) for k, v in data.items() if k in fields))
|
||||
addon.status = amo.STATUS_NULL
|
||||
addon.default_locale = to_language(translation.get_language())
|
||||
if addon.is_webapp():
|
||||
addon.manifest_url = upload.name
|
||||
addon.save()
|
||||
Version.from_upload(upload, addon, platforms)
|
||||
amo.log(amo.LOG.CREATE_ADDON, addon)
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from datetime import datetime, timedelta
|
||||
import itertools
|
||||
import os
|
||||
from datetime import datetime, timedelta
|
||||
from urlparse import urlparse
|
||||
|
||||
from django import forms
|
||||
|
@ -1322,6 +1323,14 @@ class TestAddonFromUpload(UploadTest):
|
|||
eq_(addon.description, None)
|
||||
eq_(addon.slug, 'xpi-name')
|
||||
|
||||
def test_manifest_url(self):
|
||||
path = os.path.join(settings.ROOT,
|
||||
'apps/devhub/tests/addons/mozball.webapp')
|
||||
upload = self.get_upload(abspath=path)
|
||||
addon = Addon.from_upload(upload, [self.platform])
|
||||
assert addon.is_webapp()
|
||||
eq_(addon.manifest_url, upload.name)
|
||||
|
||||
def test_xpi_version(self):
|
||||
addon = Addon.from_upload(self.get_upload('extension.xpi'),
|
||||
[self.platform])
|
||||
|
|
Загрузка…
Ссылка в новой задаче