This commit is contained in:
Andy McKay 2011-03-22 16:38:43 -07:00
Родитель 0dafbc500a
Коммит 09ec1cdf89
3 изменённых файлов: 37 добавлений и 2 удалений

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

@ -19,6 +19,15 @@ from editors.models import (ViewPendingQueue, ViewFullReviewQueue,
from editors.sql_table import SQLTable
@register.function
def file_review_status(addon, file):
if addon.status in [amo.STATUS_UNREVIEWED]:
return _('Pending Preliminary Review')
elif addon.status in [amo.STATUS_NOMINATED, amo.STATUS_LITE_AND_NOMINATED]:
return _('Pending Full Review')
return amo.STATUS_CHOICES[file.status]
@register.function
@jinja2.contextfunction
def editor_page_title(context, title=None, addon=None):

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

@ -48,13 +48,13 @@
{{ _('Files and Validation Results') }}
<span>[<a href="{{ remora_url('pages/validation') }}">{{ _('help') }}</a>]</span>
</h3>
<ul>
<ul class="files">
{% for file in version.files.all() %}
<li>
<a href="{{ remora_url('/downloads/file/%d/%s' %( file.id, file.filename)) }}">
<strong>{{ file.filename }}</strong></a>
<br>
{{ status_types[file.status] }}
{{ file_review_status(addon, file) }}
&middot;
<a href="{{ url('devhub.file_validation', addon.slug, file.id) }}">{{ _('Validation Results') }}</a>
&middot;

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

@ -1079,3 +1079,29 @@ class TestEditorMOTD(EditorTest):
r = self.client.post(reverse('editors.save_motd'), {})
doc = pq(r.content)
eq_(doc('#editor-motd .errorlist').text(), 'This field is required.')
class TestStatusFile(ReviewBase):
def setUp(self):
super(TestStatusFile, self).setUp()
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()
def test_status_full(self):
for status in [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 'Pending Full Review' in node.text()
def test_other(self):
self.addon.update(status=amo.STATUS_BETA)
res = self.client.get(self.url)
node = pq(res.content)('ul.files li:first-child')
assert unicode(amo.STATUS_CHOICES[self.file.status]) in node.text()