Skip to content

Commit

Permalink
Merge branch 'master' into fix-produce-fake-data
Browse files Browse the repository at this point in the history
  • Loading branch information
soline-b authored Jan 20, 2025
2 parents e9aa94c + dce6a7d commit 1e7c93c
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
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"
},
"personal_picture": "https://mila.quebec/wp-content/uploads/2019/08/guillaume_alain_400x700-400x400.jpg"
}
},
{
"mila_email_username": "[email protected]",
Expand Down

0 comments on commit 1e7c93c

Please sign in to comment.