moved code to redirects.py and added test

This commit is contained in:
sanjaykrishnan 2019-06-27 12:22:38 +05:30 коммит произвёл Paul McLanahan
Родитель 1dd9e24b36
Коммит a6366dc8eb
3 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -606,4 +606,7 @@ redirectpatterns = (
# issue 7210
redirect(r'^firefox/account/?$', 'firefox.accounts'),
# issue 7287
redirect(r'^accounts/?$', 'firefox.accounts'),
)

Просмотреть файл

@ -2,7 +2,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from django.conf.urls import url
from django.views.generic import RedirectView
from bedrock.mozorg.util import page
@ -30,7 +29,6 @@ urlpatterns = (
url(r'^firefox/$', views.firefox_home, name='firefox'),
url(r'^firefox/(?:%s/)?(?:%s/)?all/$' % (platform_re, channel_re),
views.firefox_all, name='firefox.all'),
url(r'^accounts/$', RedirectView.as_view(pattern_name='firefox.accounts', permanent=False)),
url(r'^firefox/accounts/', views.firefox_accounts, name='firefox.accounts'),
url(r'^firefox/campaign/$', views.campaign, name='firefox.campaign'),
page('firefox/channel/desktop', 'firefox/channel/desktop.html'),

Просмотреть файл

@ -1261,4 +1261,7 @@ URLS = flatten((
url_test('/contribute/signup/', 'https://activate.mozilla.community/'),
url_test('/contribute/task/{,devtools-challenger/, firefox-mobile/}', 'https://activate.mozilla.community/'),
url_test('/contribute/friends/', '/contribute/'),
# Issue 7287
url_test('/accounts/', '/firefox/accounts/'),
))