sync up the status at the bottom of the page (bug 645171)

This commit is contained in:
Andy McKay 2011-03-25 16:03:34 -07:00
Родитель de9495f53a
Коммит ef14266c9d
3 изменённых файлов: 10 добавлений и 7 удалений

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

@ -16,7 +16,8 @@ from applications.models import AppVersion
from editors.models import CannedResponse
from editors.helpers import ReviewHelper, ReviewAddon, ReviewFiles
from editors.helpers import (ReviewHelper, ReviewAddon, ReviewFiles,
file_review_status)
from files.models import File
@ -186,9 +187,10 @@ class QueueSearchForm(happyforms.Form):
class AddonFilesMultipleChoiceField(forms.ModelMultipleChoiceField):
def label_from_instance(self, addon_file):
# L10n: 0 = platform, 1 = filename, 2 = status message
addon = addon_file.version.addon
return jinja2.Markup(_("<strong>%s</strong> &middot; %s &middot; %s") %
(addon_file.platform, addon_file.filename,
amo.STATUS_CHOICES[addon_file.status]))
file_review_status(addon, addon_file)))
class ReviewAddonForm(happyforms.Form):

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

@ -21,7 +21,7 @@ from editors.sql_table import SQLTable
@register.function
def file_review_status(addon, file):
if addon.status in [amo.STATUS_UNREVIEWED]:
if addon.status in [amo.STATUS_UNREVIEWED, amo.STATUS_LITE]:
return _('Pending Preliminary Review')
elif addon.status in [amo.STATUS_NOMINATED, amo.STATUS_LITE_AND_NOMINATED,
amo.STATUS_PUBLIC]:

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

@ -1117,10 +1117,11 @@ class TestStatusFile(ReviewBase):
self.file = self.addon.current_version.files.all()[0]
def test_status(self):
self.addon.update(status=amo.STATUS_UNREVIEWED)
res = self.client.get(self.url)
node = pq(res.content)('ul.files li:first-child')
assert 'Pending Preliminary Review' in node.text()
for status in [amo.STATUS_UNREVIEWED, amo.STATUS_LITE]:
self.addon.update(status=status)
res = self.client.get(self.url)
node = pq(res.content)('ul.files li:first-child')
assert 'Pending Preliminary Review' in node.text()
def test_status_full(self):
for status in [amo.STATUS_NOMINATED, amo.STATUS_LITE_AND_NOMINATED,