File tree Expand file tree Collapse file tree 2 files changed +7
-11
lines changed
tests/time_tracker_api/users Expand file tree Collapse file tree 2 files changed +7
-11
lines changed Original file line number Diff line number Diff line change 33from flask .testing import FlaskClient
44from flask_restplus ._http import HTTPStatus
55from utils .azure_users import AzureConnection
6- from faker import Faker
7-
8- fake = Faker ()
96
107
118def test_users_response_contains_expected_props (
@@ -31,7 +28,7 @@ def test_users_response_contains_expected_props(
3128def test_update_user_role_response_contains_expected_props (
3229 client : FlaskClient ,
3330 valid_header : dict ,
34- user_id : dict ,
31+ user_id : str ,
3532):
3633 valid_user_role_data = {'role' : 'admin' }
3734 AzureConnection .update_user_role = Mock (
@@ -53,7 +50,7 @@ def test_update_user_role_is_being_called_with_valid_arguments(
5350 update_user_role_mock ,
5451 client : FlaskClient ,
5552 valid_header : dict ,
56- user_id : dict ,
53+ user_id : str ,
5754):
5855
5956 valid_user_role_data = {'role' : 'admin' }
@@ -62,7 +59,6 @@ def test_update_user_role_is_being_called_with_valid_arguments(
6259 )
6360
6461 assert HTTPStatus .OK == response .status_code
65- assert valid_user_role_data ['role' ] == 'admin'
6662 update_user_role_mock .assert_called_once_with (
6763 user_id , valid_user_role_data ['role' ]
6864 )
Original file line number Diff line number Diff line change 22from flask_restplus import fields , Resource
33from flask_restplus ._http import HTTPStatus
44
5- from time_tracker_api .api import common_fields , api
5+ from time_tracker_api .api import common_fields , api , NullableString
66
77faker = Faker ()
88
2525 description = 'Email of the user that belongs to the tenant' ,
2626 example = faker .email (),
2727 ),
28- 'role' : fields . String (
28+ 'role' : NullableString (
2929 title = "User's Role" ,
3030 max_length = 50 ,
3131 description = 'Role assigned to the user by the tenant' ,
32- example = faker .word (['admin' ]),
32+ example = faker .word (['time-tracker- admin' ]),
3333 ),
3434 },
3535)
3939user_input_fields = ns .model (
4040 'UserInput' ,
4141 {
42- 'role' : fields . String (
42+ 'role' : NullableString (
4343 title = "User's Role" ,
4444 required = True ,
4545 max_length = 50 ,
4646 description = 'Role assigned to the user by the tenant' ,
47- example = faker .word (['admin' ]),
47+ example = faker .word (['time-tracker- admin' ]),
4848 ),
4949 },
5050)
You can’t perform that action at this time.
0 commit comments