Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljcollinsuk committed Jan 10, 2025
1 parent 7f6472a commit ce950ed
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions tests/api/filters/test_app_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

class AppFilterTest(APITestCase):
def setUp(self):
self.superuser = baker.make("api.User", is_superuser=True)
self.app_admin = baker.make("api.User", is_superuser=False)
self.superuser = baker.make("api.User", auth0_id="github|superuser", is_superuser=True)
self.app_admin = baker.make("api.User", auth0_id="github|user", is_superuser=False)
self.app_1 = baker.make("api.App", name="App 1")
self.app_2 = baker.make("api.App", name="App 2")
baker.make("api.UserApp", user=self.app_admin, app=self.app_1, is_admin=True)
Expand Down
6 changes: 3 additions & 3 deletions tests/api/filters/test_users3bucket_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

class UserS3BucketFilterTest(APITestCase):
def setUp(self):
self.superuser = baker.make("api.User", is_superuser=True)
self.normal_user = baker.make("api.User", is_superuser=False)
self.other_user = baker.make("api.User", is_superuser=False)
self.superuser = baker.make("api.User", auth0_id="github|superuser", is_superuser=True)
self.normal_user = baker.make("api.User", auth0_id="github|user", is_superuser=False)
self.other_user = baker.make("api.User", auth0_id="github|other_user", is_superuser=False)

self.s3bucket_1 = baker.make("api.S3Bucket", name="test-bucket-1")
self.s3bucket_2 = baker.make("api.S3Bucket", name="test-bucket-2")
Expand Down
2 changes: 1 addition & 1 deletion tests/frontend/views/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def github_api_token():
def users(users):
users.update(
{
"app_admin": baker.make("api.User", username="app_admin"),
"app_admin": baker.make("api.User", auth0_id="github|user", username="app_admin"),
}
)
return users
Expand Down
2 changes: 1 addition & 1 deletion tests/frontend/views/test_app_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
def users(users):
users.update(
{
"owner": baker.make("api.User", username="owner"),
"owner": baker.make("api.User", auth0_id="github|user", username="owner"),
}
)
return users
Expand Down
8 changes: 6 additions & 2 deletions tests/frontend/views/test_datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ def enable_db_for_all_tests(db):
def users(users):
users.update(
{
"bucket_viewer": baker.make("api.User", username="bucket_viewer"),
"bucket_admin": baker.make("api.User", username="bucket_admin"),
"bucket_viewer": baker.make(
"api.User", auth0_id="github|bucket_viewer", username="bucket_viewer"
),
"bucket_admin": baker.make(
"api.User", auth0_id="github|bucket_admin", username="bucket_admin"
),
}
)
return users
Expand Down
2 changes: 1 addition & 1 deletion tests/frontend/views/test_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
def users(users):
users.update(
{
"owner": baker.make("api.User", username="owner"),
"owner": baker.make("api.User", auth0_id="github|user", username="owner"),
}
)
return users
Expand Down
2 changes: 1 addition & 1 deletion tests/frontend/views/test_secrets.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def github_api_token():
def users(users):
users.update(
{
"app_admin": baker.make("api.User", username="app_admin"),
"app_admin": baker.make("api.User", auth0_id="github|user", username="app_admin"),
}
)
return users
Expand Down
2 changes: 1 addition & 1 deletion tests/frontend/views/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def test_permission(client, users, view, user, expected_status):
@pytest.mark.parametrize(
"view,user,expected_count",
[
(list, "superuser", 5),
(list, "superuser", 6),
],
)
def test_list(client, users, view, user, expected_count):
Expand Down

0 comments on commit ce950ed

Please sign in to comment.