Update abuse API parameters (again) to match the latest PRD

This commit is contained in:
Mathieu Pillard 2019-04-16 10:01:43 +02:00
Родитель c7f16ec6de
Коммит e727c1cbe7
4 изменённых файлов: 37 добавлений и 32 удалений

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

@ -118,17 +118,18 @@ and should be truncated by the client where necessary.
Accepted values for the ``reason`` parameter:
=========================== =================================================
=========================== ================================================================
Value Description
=========================== =================================================
malware Malware
spam_or_advertising Spam or advertising
browser_takeover Search / Homepage / New tab page takeover
breaks_website Breaks websites
offensive Offensive
=========================== ================================================================
harmful Damages computer and/or data
spam_or_advertising Creates spam or advertising
browser_takeover Changes search / homepage / new tab page without informing user
broken Doesnt work, breaks websites, or slows Firefox down
offensive Hateful, violent, or illegal content
does_not_match_description Doesn't match description
does_not_work Doesn't work
=========================== =================================================
unwanted Wasn't wanted / impossible to get rid of
other Something else
=========================== ================================================================

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

@ -30,16 +30,21 @@ class AbuseReport(ModelBase):
('UNSIGNED', 5, 'Unsigned'),
)
REASONS = APIChoicesWithNone(
('MALWARE', 1, 'Malware'),
('SPAM_OR_ADVERTISING', 2, 'Spam / Advertising'),
('BROWSER_TAKEOVER', 3, 'Search / Homepage / New tab page takeover'),
('HARMFUL', 1, 'Damages computer and/or data'),
('SPAM_OR_ADVERTISING', 2, 'Creates spam or advertising'),
('BROWSER_TAKEOVER', 3, 'Changes search / homepage / new tab page '
'without informing user'),
# `4` was previously 'New tab takeover' but has been merged into the
# previous one. We avoid re-using the value.
('BREAKS_WEBSITES', 5, 'Breaks websites'),
('OFFENSIVE', 6, 'Offensive'),
('DOES_NOT_MATCH_DESCRIPTION', 7, 'Doesn\'t match description'),
('DOES_NOT_WORK', 8, 'Doesn\'t work'),
('BROKEN', 5, "Doesnt work, breaks websites, or slows Firefox down"),
('OFFENSIVE', 6, 'Hateful, violent, or illegal content'),
('DOES_NOT_MATCH_DESCRIPTION', 7, "Pretends to be something its not"),
# `8` was previously "Doesn't work" but has been merged into the
# previous one. We avoid re-using the value.
('UNWANTED', 9, "Wasn't wanted / impossible to get rid of"),
('OTHER', 10, 'Other'),
)
ADDON_INSTALL_METHODS = APIChoicesWithNone(
('AMWEBAPI', 1, 'Add-on Manager Web API'),
('LINK', 2, 'Direct link'),

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

@ -32,27 +32,26 @@ class TestAbuse(TestCase):
assert AbuseReport.REASONS.choices == (
(None, 'None'),
(1, 'Malware'),
(2, 'Spam / Advertising'),
(3, 'Search / Homepage / New tab page takeover'),
# '4' No longer exists, but is reserved.
# (4, 'New tab takeover'),
(5, 'Breaks websites'),
(6, 'Offensive'),
(7, "Doesn't match description"),
(8, "Doesn't work"),
(1, 'Damages computer and/or data'),
(2, 'Creates spam or advertising'),
(3, 'Changes search / homepage / new tab page without informing '
'user'),
(5, "Doesnt work, breaks websites, or slows Firefox down"),
(6, 'Hateful, violent, or illegal content'),
(7, "Pretends to be something its not"),
(9, "Wasn't wanted / impossible to get rid of"),
(10, 'Other'),
)
assert AbuseReport.REASONS.api_choices == (
(None, None),
(1, 'malware'),
(1, 'harmful'),
(2, 'spam_or_advertising'),
(3, 'browser_takeover'),
# '4' No longer exists, but is reserved.
# (4, 'new_tab_takeover'),
(5, 'breaks_websites'),
(5, 'broken'),
(6, 'offensive'),
(7, 'does_not_match_description'),
(8, 'does_not_work'),
(9, 'unwanted'),
(10, 'other'),
)
assert AbuseReport.ADDON_INSTALL_METHODS.choices == (

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

@ -102,7 +102,7 @@ class TestAddonAbuseReportSerializer(TestCase):
'install_date': '2019-02-25 12:19',
'operating_system': u'Ôperating System!',
'operating_system_version': '2019',
'reason': 'breaks_websites',
'reason': 'broken',
'report_entry_point': 'uninstall',
}
result = AddonAbuseReportSerializer(
@ -125,7 +125,7 @@ class TestAddonAbuseReportSerializer(TestCase):
'message': u'I am the messagê',
'operating_system': u'Ôperating System!',
'operating_system_version': '2019',
'reason': AbuseReport.REASONS.BREAKS_WEBSITES,
'reason': AbuseReport.REASONS.BROKEN,
'report_entry_point': AbuseReport.REPORT_ENTRY_POINTS.UNINSTALL,
}
assert result == expected