Add add-on slug to discovery API (fix #2751)

This commit is contained in:
Mathieu Pillard 2016-05-26 12:54:16 +02:00
Родитель 0d8f566380
Коммит 17a6f9ae76
3 изменённых файлов: 3 добавлений и 2 удалений

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

@ -21,4 +21,4 @@ Firefox (about:addons).
:>json array results: The array containing the results for this query.
:>json string results[].heading: The heading for this item. May contain the following sub-strings, that clients need to use to format the string as they desire: ``{start_sub_heading}``, ``{end_sub_heading}`` and ``{addon_name}``.
:>json string|null results[].description: The description for this item, if any. May contain some HTML tags.
:>json object results[].addon: The :ref:`add-on <addon-detail-object>` for this item. Only a subset of fields are present: ``id``, ``current_version`` (with only the ``compatibility`` and ``files`` fields present), ``guid``, ``icon_url``, ``name``, ``theme_data``, ``type`` and ``url``.
:>json object results[].addon: The :ref:`add-on <addon-detail-object>` for this item. Only a subset of fields are present: ``id``, ``current_version`` (with only the ``compatibility`` and ``files`` fields present), ``guid``, ``icon_url``, ``name``, ``slug``, ``theme_data``, ``type`` and ``url``.

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

@ -16,7 +16,7 @@ class DiscoveryAddonSerializer(AddonSerializer):
class Meta:
fields = ('id', 'current_version', 'guid', 'icon_url', 'name',
'theme_data', 'type', 'url',)
'slug', 'theme_data', 'type', 'url',)
model = Addon

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

@ -41,6 +41,7 @@ class TestDiscoveryViewList(TestCase):
assert result['heading'] == unicode(addons[item.addon_id].name)
assert result['description'] == item.description
assert result['addon']['current_version']
assert result['addon']['slug'] == addons[item.addon_id].slug
def test_missing_addon(self):
addon_factory(id=discopane_items[0].addon_id, type=amo.ADDON_PERSONA)