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

[CW-567] Modifier la génération des fake data afin de s'assurer qu'elles contiennent toujours au moins un admin #211

Merged
merged 1 commit into from
Jan 17, 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
33 changes: 0 additions & 33 deletions scripts/ensure_one_fake_admin_in_db.py

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/launch_frontend_tests_in_clockwork_dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ playwright install chromium
echo Store fake data
python3 scripts/store_fake_data_in_db.py

echo Ensure at least 1 fake admin user
python3 scripts/ensure_one_fake_admin_in_db.py

echo Launch clockwork web server in background
python3 -m flask run --host="0.0.0.0" &

Expand Down
5 changes: 5 additions & 0 deletions scripts/produce_fake_users.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ def gen_single_user(n):
# This is useful for testing permissions.
cc_account_username = "ccuser%0.2d" % n if not n % 20 == 6 else None

# One out of 20 of the users will be an admin
# (actually matching student02 in 20 first users).
admin_rights = {"admin_access": True} if n % 20 == 2 else {}

D_user = {
"mila_email_username": "student%[email protected]" % n,
"status": status,
Expand All @@ -73,6 +77,7 @@ def gen_single_user(n):
"dark_mode": False,
"language": "en" if (n % 2 == 0) else "fr",
},
**admin_rights,
}

if cc_account_username is not None:
Expand Down
4 changes: 4 additions & 0 deletions slurm_report/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# As this folder is used to generate test data,
# Git could ignore everything here, except README file.
*
!README.md
3 changes: 2 additions & 1 deletion test_common/fake_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"nbr_items_per_page": 40,
"dark_mode": false,
"language": "en"
}
},
"admin_access": true
},
{
"mila_email_username": "[email protected]",
Expand Down
Loading