Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
Surface manifest errors to form (bug 749832)
Browse files Browse the repository at this point in the history
  • Loading branch information
robhudson committed May 2, 2012
1 parent 7829435 commit f9267d0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions mkt/developers/templates/developers/apps/edit/basic.html
Expand Up @@ -57,6 +57,7 @@ <h2>
<td>
{% if editable %}
<input type="text" name="manifest_url"{% if not action_allowed('Admin', '%') %} readonly{% endif %} value="{{ addon.manifest_url }}">
{{ form.manifest_url.errors }}
<p class="note">
{% with email='app-reviews@mozilla.org' %}
Manifest URLs cannot be changed after your app has been

This comment has been minimized.

Copy link
@cvan

cvan May 2, 2012

Contributor

we probably don't need to show this note if you're an admin and you can change the manifest URL

Expand Down
8 changes: 8 additions & 0 deletions mkt/developers/tests/test_views_edit.py
Expand Up @@ -210,6 +210,14 @@ def test_view_manifest_url_default(self):
# non-admins.
eq_(self.get_webapp().manifest_url, self.webapp.manifest_url)

def test_view_edit_manifest_url_empty(self):
# Empty manifest should throw an error.
url = ''

This comment has been minimized.

Copy link
@cvan

cvan May 2, 2012

Contributor

meh

r = self.client.post(self.edit_url, self.get_dict(manifest_url=url))
form = r.context['form']
assert 'manifest_url' in form.errors
assert 'This field is required' in form.errors['manifest_url'][0]

This comment has been minimized.

Copy link
@cvan

cvan May 2, 2012

Contributor

self.assertFormErrors(r, 'form', 'basic', 'manifest_url', 'This field is required.') ?


@mock.patch('devhub.tasks.urllib2.urlopen')
def test_view_admin_edit_manifest_url(self, mock_urlopen):
mock_urlopen.return_value = response_mock
Expand Down

0 comments on commit f9267d0

Please sign in to comment.