make statuses a tuple of id, status (bug 690523)
This commit is contained in:
Родитель
681bcbfad2
Коммит
c4ec669dbd
|
@ -43,6 +43,7 @@ from amo.urlresolvers import reverse
|
|||
from api.authentication import AMOOAuthAuthentication
|
||||
from addons.models import Addon, AddonUser, BlacklistedGuid
|
||||
from devhub.models import ActivityLog, SubmitStep
|
||||
from files.models import File
|
||||
from perf.models import (Performance, PerformanceAppVersions,
|
||||
PerformanceOSVersion)
|
||||
from test_utils import RequestFactory
|
||||
|
@ -643,7 +644,8 @@ class TestAddon(BaseOAuth):
|
|||
a = Addon.objects.get(pk=data['id'])
|
||||
r = client.get(('api.version', data['id'], a.versions.get().id),
|
||||
self.accepted_consumer, self.token)
|
||||
eq_(json.loads(r.content)['statuses'], [1])
|
||||
eq_(json.loads(r.content)['statuses'],
|
||||
[[File.objects.all()[0].pk, 1]])
|
||||
|
||||
@patch('access.acl.check_addon_ownership')
|
||||
def test_not_my_addon(self, acl):
|
||||
|
|
|
@ -218,7 +218,7 @@ class Version(amo.models.ModelBase):
|
|||
@property
|
||||
def statuses(self):
|
||||
"""Unadulterated statuses, good for an API."""
|
||||
return [f.status for f in self.all_files]
|
||||
return [(f.id, f.status) for f in self.all_files]
|
||||
|
||||
def is_allowed_upload(self):
|
||||
"""Check that a file can be uploaded based on the files
|
||||
|
|
Загрузка…
Ссылка в новой задаче