Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Extend limit of feedback to 250 chars.

  • Loading branch information...
commit 5a85f07d3a506bb2f0561916c7f982f9e8aea04e 1 parent 42dd5d6
Dave Dash davedash authored
23 apps/feedback/tests/test_feedback_views.py
View
@@ -1,3 +1,5 @@
+import random
+import string
from datetime import datetime
from django.conf import settings
@@ -5,6 +7,7 @@
from nose.tools import eq_
from pyquery import PyQuery as pq
+import input
from input import FIREFOX, OPINION_PRAISE, OPINION_ISSUE
from input.tests import ViewTestCase, enforce_ua
from input.urlresolvers import reverse
@@ -33,8 +36,7 @@ def test_no_ua(self):
@enforce_ua
def test_release(self):
- version = (getattr(FIREFOX, 'default_version', None) or
- Version(LATEST_BETAS[FIREFOX]).simplified)
+ version = getattr(FIREFOX, 'default_version', None)
r = self._get_page(version)
eq_(r.status_code, 200)
@@ -111,6 +113,21 @@ def submit_url(url, valid=True):
# Try submitting add_url=on with no URL. Bug 613549.
submit_url(None)
+ def test_long_submission(self):
+ """Test that we can hit the limit of 250 for all opinion types."""
+ msg = ''.join(random.choice(string.letters) for x in xrange(249))
+
+ def req(optype):
+ return self.client.post(
+ reverse('feedback'),
+ dict(description=msg + str(optype.id), _type=optype.id),
+ HTTP_USER_AGENT=(self.FX_UA % '20.0b2'), follow=True)
+
+ for t in input.OPINION_TYPES_USAGE:
+ r = req(t)
+ eq_(r.status_code, 200)
+ assert r.content.find('Thanks for') >= 0
+
def test_submissions_without_url(self):
"""Ensure feedback without URL can be submitted. Bug 610023."""
req = lambda: self.client.post(
@@ -145,7 +162,6 @@ def with_site(site_id):
with_site(settings.DESKTOP_SITE_ID)
with_site(settings.MOBILE_SITE_ID)
-
def test_submission_with_device_info(self):
"""Ensure mobile device info can be submitted."""
r = self.client.post(
@@ -191,4 +207,3 @@ def test_thanks(self):
doc = pq(r.content)
eq_(doc('#thanks_download a').attr('href'),
'http://www.mozilla.org/firefox/channel')
-
8 apps/feedback/tests/test_release_views.py
View
@@ -1,4 +1,3 @@
-from nose import SkipTest
from nose.tools import eq_
from input import FIREFOX, LATEST_RELEASE
@@ -22,13 +21,6 @@ def test_no_ua(self):
eq_(r.status_code, 302)
assert r['Location'].endswith(reverse('feedback.download'))
- @enforce_ua
- def test_beta(self):
- """Beta version on release page: redirect."""
- raise SkipTest
- r = self._get_page('3.6b2')
- self.assertRedirects(r, reverse('feedback'), 302, 302)
-
# TODO bug 634324. Reenable this after Firefox 4 release.
@enforce_ua
def notest_old_release(self):
6 apps/input/__init__.py
View
@@ -22,8 +22,7 @@
## Opinion Type Length Restrictions
-MAX_FEEDBACK_LENGTH = 140
-MAX_IDEA_LENGTH = 250
+MAX_FEEDBACK_LENGTH = 250
## Opinion Types
@@ -45,7 +44,7 @@ class OPINION_IDEA:
id = 3
short = 'idea'
pretty = _(u'Idea')
- max_length = MAX_IDEA_LENGTH
+ max_length = MAX_FEEDBACK_LENGTH
class OPINION_RATING:
@@ -70,6 +69,7 @@ class OPINION_BROKEN:
OPINION_TYPES_USAGE = OPINION_PRAISE, OPINION_ISSUE, OPINION_IDEA
OPINION_TYPES = dict((type.id, type) for type in OPINION_TYPES_USAGE)
+
## Applications
class FIREFOX:
id = 1
Please sign in to comment.
Something went wrong with that request. Please try again.