mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-06-21 21:53:42 -04:00
redirect (301 MOVED PERMANENTLY) from old choose endpoints
This commit is contained in:
@@ -1,11 +1,22 @@
|
||||
from flask import redirect, render_template, session, url_for
|
||||
from flask_login import current_user, login_required
|
||||
from werkzeug.routing import RequestRedirect
|
||||
|
||||
from app import user_api_client
|
||||
from app.main import main
|
||||
from app.utils import is_gov_user
|
||||
|
||||
|
||||
@main.route("/services")
|
||||
def choose_service():
|
||||
raise RequestRedirect(url_for('.choose_account'))
|
||||
|
||||
|
||||
@main.route("/services-or-dashboard")
|
||||
def services_or_dashboard():
|
||||
raise RequestRedirect(url_for('.show_accounts_or_dashboard'))
|
||||
|
||||
|
||||
@main.route("/accounts")
|
||||
@login_required
|
||||
def choose_account():
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{% extends "withoutnav_template.html" %}
|
||||
|
||||
{% block per_page_title %}
|
||||
Choose account
|
||||
Choose service
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<h1 class="heading-large">
|
||||
Choose account
|
||||
Choose service
|
||||
</h1>
|
||||
<nav class="browse-list">
|
||||
<ul>
|
||||
|
||||
@@ -49,7 +49,7 @@ def test_choose_account_should_show_choose_accounts_page(
|
||||
resp = client_request.get('main.choose_account')
|
||||
page = resp.find('div', {'id': 'content'}).main
|
||||
|
||||
assert normalize_spaces(page.h1.text) == 'Choose account'
|
||||
assert normalize_spaces(page.h1.text) == 'Choose service'
|
||||
outer_list_items = page.nav.ul.find_all('li', recursive=False)
|
||||
|
||||
assert len(outer_list_items) == 6
|
||||
@@ -94,7 +94,7 @@ def test_choose_account_should_show_choose_accounts_page_if_no_services(
|
||||
links = page.findAll('a')
|
||||
assert len(links) == 1
|
||||
add_service_link = links[0]
|
||||
assert normalize_spaces(page.h1.text) == 'Choose account'
|
||||
assert normalize_spaces(page.h1.text) == 'Choose service'
|
||||
assert normalize_spaces(add_service_link.text) == 'Add a new service…'
|
||||
assert add_service_link['href'] == url_for('main.add_service')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user