Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary hardcoded value for admin_access (already handled in produce_fake_users) #214

Merged
merged 2 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions clockwork_frontend_test/test_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ def _check_dashboard_table_sorting(
# Remove last column (row order) to get only expected content.
content = [row[:-1] for row in sorted_content]
SORTED_CONTENT = content
# We assume DASHBOARD_TABLE_CONTENT is not initially sorted anyway.
assert content != DASHBOARD_TABLE_CONTENT

# Expected content is now ready for checking.
table = page.locator("table#dashboard_table")
headers = table.locator("thead tr th")
Expand Down
12 changes: 0 additions & 12 deletions scripts/insert_hardcoded_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,6 @@ def get_job_user_props_hardcoded_values(fake_data: dict):
]


def ensure_admin_users(fake_data: dict):
"""Make sure there is at least 1 fake admin."""
users = fake_data["users"]
admin_users = [user for user in users if user.get("admin_access", False)]
if not admin_users and users:
users[0]["admin_access"] = True
assert [user for user in fake_data["users"] if user.get("admin_access", False)]


def ensure_job_arrays(fake_data: dict):
"""Make sure some fake jobs belong to valid job arrays."""
jobs_with_array_id = [
Expand Down Expand Up @@ -141,9 +132,6 @@ def main(argv):
# Insert fake job user props
fake_data["job_user_props"] = get_job_user_props_hardcoded_values(fake_data)

# Make sure there are some admin users
ensure_admin_users(fake_data)

# Make sure some jobs are in valid job arrays
ensure_job_arrays(fake_data)

Expand Down
3 changes: 1 addition & 2 deletions test_common/fake_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"nbr_items_per_page": 40,
"dark_mode": false,
"language": "en"
},
"admin_access": true
}
},
{
"mila_email_username": "[email protected]",
Expand Down
Loading