3636from simcore_service_webserver .user_preferences ._service import (
3737 get_frontend_user_preferences_aggregation ,
3838)
39+ from simcore_service_webserver .users ._controller .rest .users_rest import (
40+ _PHONE_CODE_VALUE_FAKE ,
41+ )
3942from sqlalchemy .exc import OperationalError as SQLAlchemyOperationalError
4043from sqlalchemy .ext .asyncio import AsyncConnection
4144
@@ -50,6 +53,7 @@ def app_environment(
5053 {
5154 "WEBSERVER_GARBAGE_COLLECTOR" : "null" ,
5255 "WEBSERVER_DB_LISTENER" : "0" ,
56+ "WEBSERVER_DEV_FEATURES_ENABLED" : "1" , # NOTE: still under development
5357 },
5458 )
5559
@@ -626,7 +630,7 @@ async def test_phone_registration_basic_workflow(
626630 resp = await client .post (
627631 f"{ url } " ,
628632 json = {
629- "code" : "123456" ,
633+ "code" : _PHONE_CODE_VALUE_FAKE ,
630634 },
631635 )
632636 await assert_status (resp , status .HTTP_204_NO_CONTENT )
@@ -682,7 +686,7 @@ async def test_phone_registration_workflow(
682686 resp = await client .post (
683687 f"{ url } " ,
684688 json = {
685- "code" : "123456" ,
689+ "code" : _PHONE_CODE_VALUE_FAKE ,
686690 },
687691 )
688692 await assert_status (resp , status .HTTP_204_NO_CONTENT )
@@ -735,7 +739,7 @@ async def test_phone_registration_with_resend(
735739 resp = await client .post (
736740 f"{ url } " ,
737741 json = {
738- "code" : "123456" ,
742+ "code" : _PHONE_CODE_VALUE_FAKE ,
739743 },
740744 )
741745 await assert_status (resp , status .HTTP_204_NO_CONTENT )
@@ -775,7 +779,7 @@ async def test_phone_registration_change_existing_phone(
775779 resp = await client .post (
776780 f"{ url } " ,
777781 json = {
778- "code" : "123456" ,
782+ "code" : _PHONE_CODE_VALUE_FAKE ,
779783 },
780784 )
781785 await assert_status (resp , status .HTTP_204_NO_CONTENT )
@@ -795,36 +799,7 @@ async def test_phone_registration_change_existing_phone(
795799 resp = await client .post (
796800 f"{ url } " ,
797801 json = {
798- "code" : "123456" ,
799- },
800- )
801- await assert_status (resp , status .HTTP_204_NO_CONTENT )
802-
803- # GET updated profile
804- url = client .app .router ["get_my_profile" ].url_for ()
805- resp = await client .get (f"{ url } " )
806- data , _ = await assert_status (resp , status .HTTP_200_OK )
807-
808- updated_profile = MyProfileRestGet .model_validate (data )
809-
810- # Verify phone was updated to new phone
811- assert updated_profile .phone == new_phone
812- assert updated_profile .phone != first_phone
813- new_phone = faker .phone_number ()
814- url = client .app .router ["register_my_phone_init" ].url_for ()
815- resp = await client .post (
816- f"{ url } " ,
817- json = {
818- "phone" : new_phone ,
819- },
820- )
821- await assert_status (resp , status .HTTP_202_ACCEPTED )
822-
823- url = client .app .router ["register_my_phone_confirm" ].url_for ()
824- resp = await client .post (
825- f"{ url } " ,
826- json = {
827- "code" : "123456" ,
802+ "code" : _PHONE_CODE_VALUE_FAKE ,
828803 },
829804 )
830805 await assert_status (resp , status .HTTP_204_NO_CONTENT )
0 commit comments