Skip to content

Commit c405380

Browse files
committed
Fix some tests
1 parent aa4e6a1 commit c405380

5 files changed

Lines changed: 12 additions & 18 deletions

File tree

tests/test_auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def test_confirm_email(self):
9696
res = self.app.resolve_redirect(res)
9797

9898
assert res.status_code == 302
99-
assert '/my-projects/' == urlparse(res.location).path
99+
assert '/dashboard/' == urlparse(res.location).path
100100
# assert len(get_session()['status']) == 1
101101

102102
def test_get_user_by_id(self):

tests/test_auth_basic_auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,4 @@ def test_expired_cookie(self):
9999
self.app.set_cookie(settings.COOKIE_NAME, str(cookie))
100100
res = self.app.get(self.reachable_url)
101101
assert res.status_code == 302
102-
assert '/login/' == res.location
102+
assert 'http://localhost:5000/logout/?next=http://localhost:4200/' == res.location

tests/test_auth_views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ def test_logout_with_angular_next_url_logged_in(self):
846846
assert cas.get_logout_url(logout_url) == resp.headers['Location']
847847

848848
def test_logout_with_angular_next_url_logged_out(self):
849-
angular_url = 'http://localhost:4200/'q
849+
angular_url = 'http://localhost:4200/'
850850
logout_url = web_url_for('auth_logout', _absolute=True, next=angular_url)
851851
resp = self.app.get(logout_url, auth=None)
852852
assert resp.status_code == http_status.HTTP_302_FOUND

tests/test_campaigns.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ def setUp(self):
238238
super().setUp()
239239
self.url_login = web_url_for('auth_login', campaign='institution')
240240
self.url_register = web_url_for('auth_register', campaign='institution')
241-
self.service_url = web_url_for('my_projects', _absolute=True)
241+
self.service_url = web_url_for('dashboard', _absolute=True, _anchor=True)
242242

243243
# go to CAS institution login page if not logged in
244244
def test_institution_not_logged_in(self):

tests/test_webtests.py

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,27 +87,23 @@ def test_is_redirected_to_cas_if_not_logged_in_at_login_page(self):
8787
location = res.headers.get('Location')
8888
assert 'login?service=' in location
8989

90-
def test_is_redirected_to_myprojects_if_already_logged_in_at_login_page(self):
90+
def test_is_redirected_to_dashboard_if_already_logged_in_at_login_page(self):
9191
res = self.app.get('/login/', auth=self.user.auth)
9292
assert res.status_code == 302
93-
assert 'my-projects' in res.headers.get('Location')
93+
assert 'dashboard' in res.headers.get('Location')
9494

9595
def test_register_page(self):
9696
res = self.app.get('/register/')
9797
assert res.status_code == 200
9898

99-
def test_is_redirected_to_myprojects_if_already_logged_in_at_register_page(self):
99+
def test_is_redirected_to_dashboard_if_already_logged_in_at_register_page(self):
100100
res = self.app.get('/register/', auth=self.user.auth)
101101
assert res.status_code == 302
102-
assert 'my-projects' in res.headers.get('Location')
102+
assert 'dashboard' in res.headers.get('Location')
103103

104104
def test_sees_projects_in_her_dashboard(self):
105-
# the user already has a project
106-
project = ProjectFactory(creator=self.user)
107-
project.add_contributor(self.user)
108-
project.save()
109-
res = self.app.get('/my-projects/', auth=self.user.auth)
110-
assert 'Projects' in res.text # Projects heading
105+
# Deprecated test, dashboard and my-projects are angular pages
106+
pass
111107

112108
def test_does_not_see_osffiles_in_user_addon_settings(self):
113109
res = self.app.get('/settings/addons/', auth=self.auth, follow_redirects=True)
@@ -123,10 +119,8 @@ def test_sees_osffiles_in_project_addon_settings(self):
123119
assert 'OSF Storage' in res.text
124120

125121
def test_sees_correct_title_on_dashboard(self):
126-
# User goes to dashboard
127-
res = self.app.get('/my-projects/', auth=self.auth, follow_redirects=True)
128-
title = res.html.title.string
129-
assert 'OSF | My Projects' == title
122+
# Deprecated test, dashboard and my-projects are angular pages
123+
pass
130124

131125
def test_can_see_make_public_button_if_admin(self):
132126
# User is a contributor on a project

0 commit comments

Comments
 (0)