Skip to content

Commit

Permalink
fixing abuse report redirect (bug 621361)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Balogh committed Dec 27, 2010
1 parent 8f91838 commit 0499ddd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions apps/addons/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -881,14 +881,16 @@ def setUp(self):
self.full_page = reverse('addons.abuse', args=['a3615'])

def test_abuse_persona(self):
r = self.client.get(reverse('addons.detail', args=['a15663']))
addon_url = reverse('addons.detail', args=['a15663'])
r = self.client.get(addon_url)
doc = pq(r.content)
assert doc("fieldset.abuse")

# and now just test it works
self.client.login(username='regular@mozilla.com', password='password')
self.client.post(reverse('addons.abuse', args=['a15663']),
{'text': 'spammy'})
r = self.client.post(reverse('addons.abuse', args=['a15663']),
{'text': 'spammy'})
self.assertRedirects(r, addon_url)
eq_(len(mail.outbox), 1)
assert 'spammy' in mail.outbox[0].body

Expand Down
2 changes: 1 addition & 1 deletion apps/addons/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ def report_abuse(request, addon):
else:
return jingo.render(request, 'addons/report_abuse_full.html',
{'addon': addon, 'abuse_form': form, })
return redirect('addons.detail', args=[addon.slug])
return redirect('addons.detail', addon.slug)


@cache_page(3600)
Expand Down

0 comments on commit 0499ddd

Please sign in to comment.