File status for pending updates is incorrect (bug 650439)
This commit is contained in:
Родитель
6c804bc933
Коммит
110db14638
|
@ -21,13 +21,12 @@ from editors.sql_table import SQLTable
|
|||
|
||||
@register.function
|
||||
def file_review_status(addon, file):
|
||||
if file.status not in [amo.STATUS_DISABLED]:
|
||||
if file.status in [amo.STATUS_UNREVIEWED, amo.STATUS_LITE]:
|
||||
if file.status not in [amo.STATUS_DISABLED, amo.STATUS_PUBLIC]:
|
||||
if addon.status in [amo.STATUS_UNREVIEWED, amo.STATUS_LITE]:
|
||||
return _(u'Pending Preliminary Review')
|
||||
elif file.status in [amo.STATUS_PUBLIC]:
|
||||
return _(u'Fully Reviewed')
|
||||
elif file.status in [amo.STATUS_NOMINATED,
|
||||
amo.STATUS_LITE_AND_NOMINATED]:
|
||||
elif addon.status in [amo.STATUS_NOMINATED,
|
||||
amo.STATUS_LITE_AND_NOMINATED,
|
||||
amo.STATUS_PUBLIC]:
|
||||
return _(u'Pending Full Review')
|
||||
return amo.STATUS_CHOICES[file.status]
|
||||
|
||||
|
|
|
@ -1328,7 +1328,7 @@ class TestStatusFile(ReviewBase):
|
|||
self.addon.update(status=status)
|
||||
res = self.client.get(self.url)
|
||||
node = pq(res.content)('ul.files li:first-child')
|
||||
assert 'Listed' in node.text()
|
||||
assert 'Pending Preliminary Review' in node.text()
|
||||
|
||||
def test_status_full(self):
|
||||
for status in [amo.STATUS_NOMINATED, amo.STATUS_LITE_AND_NOMINATED,
|
||||
|
@ -1336,7 +1336,18 @@ class TestStatusFile(ReviewBase):
|
|||
self.addon.update(status=status)
|
||||
res = self.client.get(self.url)
|
||||
node = pq(res.content)('ul.files li:first-child')
|
||||
assert 'Listed' in node.text()
|
||||
assert 'Pending Full Review' in node.text()
|
||||
|
||||
def test_status_full_reviewed(self):
|
||||
version_file = self.addon.versions.all()[0].files.all()[0]
|
||||
version_file.update(status=amo.STATUS_PUBLIC)
|
||||
|
||||
for status in [amo.STATUS_UNREVIEWED, amo.STATUS_LITE,
|
||||
amo.STATUS_NOMINATED, amo.STATUS_LITE_AND_NOMINATED]:
|
||||
self.addon.update(status=status)
|
||||
res = self.client.get(self.url)
|
||||
node = pq(res.content)('ul.files li:first-child')
|
||||
assert 'Fully Reviewed' in node.text()
|
||||
|
||||
def test_other(self):
|
||||
self.addon.update(status=amo.STATUS_BETA)
|
||||
|
|
Загрузка…
Ссылка в новой задаче