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

Commit

Permalink
bug 564508, Adds redirects for /persona/:id -> /addon/:id.
Browse files Browse the repository at this point in the history
  • Loading branch information
davedash committed May 12, 2010
1 parent 2baf735 commit 3befdb1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions apps/amo/tests/test_redirects.py
Expand Up @@ -9,6 +9,11 @@ class TestRedirects(test.TestCase):

fixtures = ['amo/test_redirects', 'base/global-stats']

def test_persona(self):
"""`/persona/\d+` should go to `/addon/\d+`."""
r = self.client.get(u'persona/4', follow=True)
assert r.redirect_chain[-1][0].endswith('/en-US/firefox/addon/4/')

def test_utf8(self):
"""Without proper unicode handling this will fail."""
response = self.client.get(u'/api/1.5/search/ツールバー',
Expand Down
5 changes: 5 additions & 0 deletions urls.py
Expand Up @@ -63,8 +63,13 @@

('^pages/about$',
lambda r: redirect('pages.about', permanent=True)),

('^pages/faq$',
lambda r: redirect('pages.faq', permanent=True)),

# Redirect persona/xxx
('^persona/(\d+)',
lambda r, id: redirect('addons.detail', id, permanent=True))
)

if settings.DEBUG:
Expand Down

0 comments on commit 3befdb1

Please sign in to comment.