Add to collection -> Start a new collection on addon pages shows error when description is longer than 200 chars (bug 725643) #288

Closed
wants to merge 1 commit into
from

Projects

None yet

4 participants

@vaidik
Contributor
vaidik commented Feb 23, 2012

https://bugzilla.mozilla.org/show_bug.cgi?id=725643

Collection description is not allowed to be more than 200 chars. On entering a description longer than 200, the form doesn't work and doesn't show an error as well.

@vaidik
Contributor
vaidik commented Feb 24, 2012

Forgot that one. Fixed! Please review.

@vaidik vaidik Add to collection -> Start a new collection on addon pages shows erro…
…r when description is longer than 200 chars (bug 725643)
54ecab1
@vaidik
Contributor
vaidik commented Mar 3, 2012

Got most of the unwanted things from another existing test which I used to write this test. I have fixed the indentation in the other test as well. Please review.

@cvan

this could form.description.errors too. either way works.

@cvan

a better test would be to check 201 - because we don't know what happens for anything between 200 and 250.

@mattbasta mattbasta commented on the diff Dec 29, 2012
apps/bandwagon/tests/test_views.py
doc = pq(r.content)
eq_(len(doc('li.selected')), 1, "The new collection is not selected.")
eq_(Collection.objects.all().count(), num_collections + 1)
+ def test_new_collection_long_description(self):
+ r = self.client.post(reverse('collections.ajax_new'),
+ {'addon_id': 5299,
+ 'name': 'foo',
+ 'slug': 'auniqueone',
+ 'description': '1'*250,
+ 'listed': True},
+ follow=True)
+ self.assertFormError(r, 'form', 'description',
+ 'Ensure this value has at '
@mattbasta
mattbasta Dec 29, 2012 Contributor

weird indentation right there

@andymckay
Member

is this good to merge?

@mattbasta
Contributor

Vaidik: If you rebase and fix any merge conflicts, I'll merge. Thanks!

@cvan
Member
cvan commented Aug 19, 2013

can we merge this?

@cvan cvan closed this Aug 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment