Skip to content

Commit

Permalink
Merge pull request #13 from ministryofjustice/enable-extra-test-users
Browse files Browse the repository at this point in the history
Enable extra test users
  • Loading branch information
PepperMoJ authored Nov 2, 2023
2 parents adf311a + fe9053c commit 92bea8d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
9 changes: 8 additions & 1 deletion app/services/user_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ def __init__(self, db_client: DBClient, allowed_users=None):
if allowed_users is None:
allowed_users = [
'connormaglynn',
'PepperMoJ'
'PepperMoJ',
'githubgary',
'githubgeorge',
'KeithTheCoder',
'DaveTheCoder',
'sarahsaurus',
'PaulRudd',
'PaulRudd2'
]
self.__allowed_users = allowed_users

Expand Down
12 changes: 11 additions & 1 deletion app/tests/routes/test_api_route.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,17 @@ def test_adds_users(self):
app.create_app(mock_db_client).test_client().post('/api/user/add', json=users_post_data).data)
self.assertEqual(users_post_data, response)
mock_db_client.add_users.assert_called_once_with(
users_post_data['users'], ['connormaglynn', 'PepperMoJ'])
users_post_data['users'], [
'connormaglynn',
'PepperMoJ',
'githubgary',
'githubgeorge',
'KeithTheCoder',
'DaveTheCoder',
'sarahsaurus',
'PaulRudd',
'PaulRudd2'
])


class TestDeleteAllUsers(unittest.TestCase):
Expand Down
12 changes: 11 additions & 1 deletion app/tests/services/test_user_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,17 @@ def test_calls_downstream_services(self):
UserService(mock_db_client).add_users(
users_post_data)
mock_db_client.add_users.assert_called_once_with(
users_post_data, ['connormaglynn', 'PepperMoJ'])
users_post_data, [
'connormaglynn',
'PepperMoJ',
'githubgary',
'githubgeorge',
'KeithTheCoder',
'DaveTheCoder',
'sarahsaurus',
'PaulRudd',
'PaulRudd2'
])


class TestDeleteAllUsers(unittest.TestCase):
Expand Down

0 comments on commit 92bea8d

Please sign in to comment.