@@ -551,32 +551,32 @@ def setUp(self):
551551 self .no_auth = Auth ()
552552 self .user_auth = AuthUserFactory ()
553553 self .auth = Auth (user = self .user_auth )
554- self .next_url = web_url_for ('my_projects ' , _absolute = True )
554+ self .next_url = web_url_for ('dashboard ' , _absolute = True , _angular_route = True )
555555 self .invalid_campaign = 'invalid_campaign'
556556
557557 def test_osf_login_with_auth (self ):
558558 # login: user with auth
559559 data = login_and_register_handler (self .auth )
560560 assert data .get ('status_code' ) == http_status .HTTP_302_FOUND
561- assert data .get ('next_url' ) == web_url_for ('my_projects ' , _absolute = True )
561+ assert data .get ('next_url' ) == web_url_for ('dashboard ' , _absolute = True , _angular_route = True )
562562
563563 def test_osf_login_without_auth (self ):
564564 # login: user without auth
565565 data = login_and_register_handler (self .no_auth )
566566 assert data .get ('status_code' ) == http_status .HTTP_302_FOUND
567- assert data .get ('next_url' ) == web_url_for ('my_projects ' , _absolute = True )
567+ assert data .get ('next_url' ) == web_url_for ('dashboard ' , _absolute = True , _angular_route = True )
568568
569569 def test_osf_register_with_auth (self ):
570570 # register: user with auth
571571 data = login_and_register_handler (self .auth , login = False )
572572 assert data .get ('status_code' ) == http_status .HTTP_302_FOUND
573- assert data .get ('next_url' ) == web_url_for ('my_projects ' , _absolute = True )
573+ assert data .get ('next_url' ) == web_url_for ('dashboard ' , _absolute = True , _angular_route = True )
574574
575575 def test_osf_register_without_auth (self ):
576576 # register: user without auth
577577 data = login_and_register_handler (self .no_auth , login = False )
578578 assert data .get ('status_code' ) == http_status .HTTP_200_OK
579- assert data .get ('next_url' ) == web_url_for ('my_projects ' , _absolute = True )
579+ assert data .get ('next_url' ) == web_url_for ('dashboard ' , _absolute = True , _angular_route = True )
580580
581581 def test_next_url_login_with_auth (self ):
582582 # next_url login: user with auth
@@ -585,13 +585,13 @@ def test_next_url_login_with_auth(self):
585585 assert data .get ('next_url' ) == self .next_url
586586
587587 def test_next_url_angular_login_with_auth (self ):
588- data = login_and_register_handler (self .auth , next_url = settings .LOCAL_ANGULAR_URL )
588+ data = login_and_register_handler (self .auth , next_url = settings .LOCAL_ANGULAR_DOMAIN )
589589 assert data .get ('status_code' ) == http_status .HTTP_302_FOUND
590- assert data .get ('next_url' ) == settings .LOCAL_ANGULAR_URL
590+ assert data .get ('next_url' ) == settings .LOCAL_ANGULAR_DOMAIN
591591
592592 def test_next_url_angular_login_without_auth (self ):
593- request .url = web_url_for ('auth_login' , next = settings .LOCAL_ANGULAR_URL , _absolute = True )
594- data = login_and_register_handler (self .no_auth , next_url = settings .LOCAL_ANGULAR_URL )
593+ request .url = web_url_for ('auth_login' , next = settings .LOCAL_ANGULAR_DOMAIN , _absolute = True )
594+ data = login_and_register_handler (self .no_auth , next_url = settings .LOCAL_ANGULAR_DOMAIN )
595595 assert data .get ('status_code' ) == http_status .HTTP_302_FOUND
596596 assert data .get ('next_url' ) == cas .get_login_url (request .url )
597597
@@ -621,14 +621,16 @@ def test_institution_login_with_auth(self):
621621 # institution login: user with auth
622622 data = login_and_register_handler (self .auth , campaign = 'institution' )
623623 assert data .get ('status_code' ) == http_status .HTTP_302_FOUND
624- assert data .get ('next_url' ) == web_url_for ('my_projects ' , _absolute = True )
624+ assert data .get ('next_url' ) == web_url_for ('dashboard ' , _absolute = True , _angular_route = True )
625625
626626 def test_institution_login_without_auth (self ):
627627 # institution login: user without auth
628628 data = login_and_register_handler (self .no_auth , campaign = 'institution' )
629629 assert data .get ('status_code' ) == http_status .HTTP_302_FOUND
630- assert data .get ('next_url' ) == cas .get_login_url (web_url_for ('my_projects' , _absolute = True ),
631- campaign = 'institution' )
630+ assert data .get ('next_url' ) == cas .get_login_url (
631+ web_url_for ('dashboard' , _absolute = True , _angular_route = True ),
632+ campaign = 'institution'
633+ )
632634
633635 def test_institution_login_next_url_with_auth (self ):
634636 # institution login: user with auth and next url
@@ -646,13 +648,16 @@ def test_institution_register_with_auth(self):
646648 # institution register: user with auth
647649 data = login_and_register_handler (self .auth , login = False , campaign = 'institution' )
648650 assert data .get ('status_code' ) == http_status .HTTP_302_FOUND
649- assert data .get ('next_url' ) == web_url_for ('my_projects ' , _absolute = True )
651+ assert data .get ('next_url' ) == web_url_for ('dashboard ' , _absolute = True , _angular_route = True )
650652
651653 def test_institution_register_without_auth (self ):
652654 # institution register: user without auth
653655 data = login_and_register_handler (self .no_auth , login = False , campaign = 'institution' )
654656 assert data .get ('status_code' ) == http_status .HTTP_302_FOUND
655- assert data .get ('next_url' ) == cas .get_login_url (web_url_for ('my_projects' , _absolute = True ), campaign = 'institution' )
657+ assert data .get ('next_url' ) == cas .get_login_url (
658+ web_url_for ('dashboard' , _absolute = True , _angular_route = True ),
659+ campaign = 'institution'
660+ )
656661
657662 def test_campaign_login_with_auth (self ):
658663 for campaign in get_campaigns ():
@@ -838,15 +843,13 @@ def test_logout_with_no_parameter(self):
838843 assert resp .status_code == http_status .HTTP_302_FOUND
839844 assert cas .get_logout_url (self .goodbye_url ) == resp .headers ['Location' ]
840845
841- @mock .patch ('framework.auth.views.settings.LOCAL_ANGULAR_URL' , 'http://localhost:4200' )
842846 def test_logout_with_angular_next_url_logged_in (self ):
843847 angular_url = 'http://localhost:4200/'
844848 logout_url = web_url_for ('auth_logout' , _absolute = True , next = angular_url )
845849 resp = self .app .get (logout_url , auth = self .auth_user .auth )
846850 assert resp .status_code == http_status .HTTP_302_FOUND
847851 assert cas .get_logout_url (logout_url ) == resp .headers ['Location' ]
848852
849- @mock .patch ('framework.auth.views.settings.LOCAL_ANGULAR_URL' , 'http://localhost:4200' )
850853 def test_logout_with_angular_next_url_logged_out (self ):
851854 angular_url = 'http://localhost:4200/'
852855 logout_url = web_url_for ('auth_logout' , _absolute = True , next = angular_url )
0 commit comments