Display optional_permissions on the add-on review page (#15109)
This commit is contained in:
Родитель
32faed1c66
Коммит
ef9225ff7f
|
@ -29,6 +29,7 @@
|
|||
{% endif %}
|
||||
{% if file[0].is_webextension %}
|
||||
<div class="file-permissions"><strong>{{ _('Permissions:') }}</strong> {{ ', '.join(file[0].permissions) or _('None') }}</div>
|
||||
<div class="file-permissions"><strong>{{ _('Optional permissions:') }}</strong> {{ ', '.join(file[0].optional_permissions) or _('None') }}</div>
|
||||
{% endif %}
|
||||
</span>
|
||||
</li>
|
||||
|
|
|
@ -5115,8 +5115,10 @@ class TestReview(ReviewBase):
|
|||
|
||||
def test_permissions_display(self):
|
||||
permissions = ['bookmarks', 'high', 'voltage']
|
||||
optional_permissions = ['optional', 'high', 'voltage']
|
||||
self.file.update(is_webextension=True)
|
||||
WebextPermission.objects.create(
|
||||
optional_permissions=optional_permissions,
|
||||
permissions=permissions,
|
||||
file=self.file)
|
||||
response = self.client.get(self.url)
|
||||
|
@ -5124,6 +5126,8 @@ class TestReview(ReviewBase):
|
|||
doc = pq(response.content)
|
||||
info = doc('#versions-history .file-info div')
|
||||
assert info.eq(1).text() == 'Permissions: ' + ', '.join(permissions)
|
||||
assert info.eq(2).text() == 'Optional permissions: ' + \
|
||||
', '.join(optional_permissions)
|
||||
|
||||
def test_abuse_reports(self):
|
||||
report = AbuseReport.objects.create(
|
||||
|
|
Загрузка…
Ссылка в новой задаче