-
Notifications
You must be signed in to change notification settings - Fork 30
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
feat(test-data): Adds 'create_dummy_data' command #1064
base: master
Are you sure you want to change the base?
feat(test-data): Adds 'create_dummy_data' command #1064
Conversation
Adds 'create_dummy_data' command to generate test data to use when developing. Changes provider 'Activity' (which creates fake activity names) to allow specifying a year instead of using random.
PR Summary
|
Departments no longer uses a factory that creates a "closed_dtm". but is set to None. This fixes a bug that made departments closed. Departments' address.region is now the region of their union. Unions are now in the right region. Also includes minor code additions to prepare for a refactoring of handle() and the UNIONS_TO_CREATE list.
Each union used to be named "Region ____". which made it easy to use the union's name as the name of the region too (since there's a union for each region). However this made the names wierd, because the union for Syddanmark should be named "Syddanmark", not "Region Syddanmark". The commit refactors the UNIONS_TO_CREATE list to contain named tuples which has "union_name" and "region_name". This fixes the wierd names and makes it possible to have a union be called something completely unrelated to the region its in, should you want that.
Setup of the waitlist, is moved into its own _setup_waitlist() function. It creates two children and puts them on a waitlist for two departments (which handle() supplies) The function is very 'static' and only does what is required (no parameters for alternative options). Hopefully, moving the code to its own function. will provide an easier opportunity to expand it later on. This update also fixes a bug with the help text.
The ActivityFactory made the signup_closing field be a date +/-100 days from when the script was run. This made some acitivities not show up in the activities overview of the website, since the signup had already closed. This is now fixed by setting signup_closed to a date 1-10 days in the future.
Adds 'create_dummy_data' command to generate test data to use when developing.
Changes provider 'Activity' (which creates fake activity names) to allow specifying a year instead of using random.
solve #664