File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -838,6 +838,22 @@ def test_logout_with_no_parameter(self):
838838 assert resp .status_code == http_status .HTTP_302_FOUND
839839 assert cas .get_logout_url (self .goodbye_url ) == resp .headers ['Location' ]
840840
841+ @mock .patch ('framework.auth.views.settings.LOCAL_ANGULAR_URL' , 'http://localhost:4200' )
842+ def test_logout_with_angular_next_url_logged_in (self ):
843+ angular_url = 'http://localhost:4200/'
844+ logout_url = web_url_for ('auth_logout' , _absolute = True , next = angular_url )
845+ resp = self .app .get (logout_url , auth = self .auth_user .auth )
846+ assert resp .status_code == http_status .HTTP_302_FOUND
847+ assert cas .get_logout_url (logout_url ) == resp .headers ['Location' ]
848+
849+ @mock .patch ('framework.auth.views.settings.LOCAL_ANGULAR_URL' , 'http://localhost:4200' )
850+ def test_logout_with_angular_next_url_logged_out (self ):
851+ angular_url = 'http://localhost:4200/'
852+ logout_url = web_url_for ('auth_logout' , _absolute = True , next = angular_url )
853+ resp = self .app .get (logout_url , auth = None )
854+ assert resp .status_code == http_status .HTTP_302_FOUND
855+ assert angular_url == resp .headers ['Location' ]
856+
841857
842858class TestResetPassword (OsfTestCase ):
843859
You can’t perform that action at this time.
0 commit comments