From 064466ecd0abb0fb6e29d2b468d5ae5d442ec1dc Mon Sep 17 00:00:00 2001 From: Gregory Koberger Date: Fri, 31 Dec 2010 01:13:24 -0500 Subject: [PATCH] Bug 621992 - Developer comments should not be a required field --- apps/addons/forms.py | 2 +- apps/devhub/tests/test_views.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/apps/addons/forms.py b/apps/addons/forms.py index 8098a5a450..47efbe5360 100644 --- a/apps/addons/forms.py +++ b/apps/addons/forms.py @@ -286,7 +286,7 @@ class AddonFormSupport(AddonFormBase): class AddonFormTechnical(AddonFormBase): - developer_comments = TransField(widget=TransTextarea) + developer_comments = TransField(widget=TransTextarea, required=False) class Meta: model = Addon diff --git a/apps/devhub/tests/test_views.py b/apps/devhub/tests/test_views.py index dc16059611..a06384fbe0 100644 --- a/apps/devhub/tests/test_views.py +++ b/apps/devhub/tests/test_views.py @@ -1650,6 +1650,23 @@ class TestEdit(test_utils.TestCase): eq_(addon.site_specific, False) eq_(addon.view_source, False) + def test_technical_devcomment_notrequired(self): + data = dict(developer_comments='', + binary='on', + external_software='on', + site_specific='on', + view_source='on') + + r = self.client.post(self.get_url('technical', True), data) + eq_(r.context['form'].errors, {}) + + addon = self.get_addon() + for k in data: + if k == 'developer_comments': + eq_(unicode(getattr(addon, k)), unicode(data[k])) + else: + eq_(getattr(addon, k), True if data[k] == 'on' else False) + def test_nav_links(self): url = reverse('devhub.addons.edit', args=['a3615']) activity_url = reverse('devhub.feed', args=['a3615'])