Skip to content

Commit

Permalink
chore: replace fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
Topvennie committed Apr 16, 2024
1 parent e3fa519 commit b934c4b
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion backend/api/fixtures/large/large.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion backend/api/fixtures/medium/medium.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion backend/api/fixtures/small/small.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"model": "api.course", "pk": 1, "fields": {"name": "Reduced didactic methodology", "academic_startyear": 2024, "description": "This great generation mouth sure case memory.", "faculty": "Economie_Bedrijfskunde", "parent_course": null}}, {"model": "api.course", "pk": 2, "fields": {"name": "Ameliorated intermediate analyzer", "academic_startyear": 2023, "description": "Of together finish possible. Art rule court stage watch campaign. Professor you over throw yet site.", "faculty": "Farmaceutische_Wetenschappen", "parent_course": null}}, {"model": "api.course", "pk": 3, "fields": {"name": "Synergized holistic concept", "academic_startyear": 2023, "description": "Term hand everybody he. Thousand peace heart financial history into successful.", "faculty": "Psychologie_PedagogischeWetenschappen", "parent_course": null}}, {"model": "api.project", "pk": 1, "fields": {"name": "Enterprise-wide maximized interface", "description": "Property nation discussion peace eight economic break conference. May now almost.", "visible": false, "archived": false, "locked_groups": true, "start_date": "2024-05-03T11:09:05.408Z", "deadline": "2024-04-21T11:09:05.408Z", "max_score": 97, "score_visible": true, "group_size": 13, "course": 2}}, {"model": "api.project", "pk": 2, "fields": {"name": "Universal well-modulated instruction set", "description": "Lot discover watch single happen again energy defense. Either wait letter.", "visible": true, "archived": false, "locked_groups": true, "start_date": "2024-03-11T11:09:05.408Z", "deadline": "2024-05-31T11:09:05.408Z", "max_score": 43, "score_visible": true, "group_size": 2, "course": 1}}, {"model": "api.project", "pk": 3, "fields": {"name": "Function-based value-added challenge", "description": "Dog include to school interview any. Issue newspaper general quickly organization.", "visible": true, "archived": false, "locked_groups": false, "start_date": "2024-02-16T11:09:05.408Z", "deadline": "2024-05-22T11:09:05.408Z", "max_score": 10, "score_visible": false, "group_size": 11, "course": 2}}, {"model": "api.project", "pk": 4, "fields": {"name": "Progressive global throughput", "description": "Before project theory down money area maybe. Drug raise of purpose guy shoulder. Goal include just fill just ten.", "visible": true, "archived": false, "locked_groups": false, "start_date": "2024-06-29T11:09:05.408Z", "deadline": "2024-07-14T11:09:05.408Z", "max_score": 90, "score_visible": false, "group_size": 7, "course": 2}}, {"model": "api.student", "pk": "0", "fields": {"is_active": true, "student_id": "0", "courses": [1]}}, {"model": "api.student", "pk": "1", "fields": {"is_active": true, "student_id": "1", "courses": [1]}}, {"model": "api.student", "pk": "2", "fields": {"is_active": true, "student_id": "2", "courses": [1]}}, {"model": "api.student", "pk": "3", "fields": {"is_active": true, "student_id": "3", "courses": [1]}}, {"model": "api.student", "pk": "4", "fields": {"is_active": true, "student_id": "4", "courses": [1]}}, {"model": "api.student", "pk": "5", "fields": {"is_active": true, "student_id": "5", "courses": [1]}}, {"model": "api.student", "pk": "6", "fields": {"is_active": true, "student_id": "6", "courses": [1]}}, {"model": "api.student", "pk": "7", "fields": {"is_active": true, "student_id": "7", "courses": [1]}}, {"model": "api.student", "pk": "8", "fields": {"is_active": true, "student_id": "8", "courses": [1]}}, {"model": "api.student", "pk": "9", "fields": {"is_active": true, "student_id": "9", "courses": [1]}}, {"model": "api.group", "pk": 1, "fields": {"project": 4, "score": 29.0, "students": []}}, {"model": "api.group", "pk": 2, "fields": {"project": 1, "score": 96.0, "students": []}}, {"model": "api.group", "pk": 3, "fields": {"project": 2, "score": 0.0, "students": ["0", "2", "3", "5", "8", "9"]}}, {"model": "api.group", "pk": 4, "fields": {"project": 1, "score": 82.0, "students": ["4", "6", "7"]}}, {"model": "api.group", "pk": 5, "fields": {"project": 3, "score": 5.0, "students": []}}, {"model": "api.group", "pk": 6, "fields": {"project": 1, "score": 64.0, "students": ["1"]}}, {"model": "api.group", "pk": 7, "fields": {"project": 2, "score": 25.0, "students": []}}, {"model": "api.assistant", "pk": "10", "fields": {"is_active": true, "courses": [1]}}, {"model": "api.assistant", "pk": "11", "fields": {"is_active": true, "courses": [1]}}, {"model": "api.assistant", "pk": "12", "fields": {"is_active": true, "courses": [2]}}, {"model": "api.assistant", "pk": "13", "fields": {"is_active": true, "courses": [1]}}, {"model": "api.assistant", "pk": "14", "fields": {"is_active": true, "courses": [2]}}, {"model": "api.teacher", "pk": "15", "fields": {"is_active": true, "courses": [2]}}, {"model": "api.teacher", "pk": "16", "fields": {"is_active": true, "courses": [1]}}, {"model": "api.teacher", "pk": "17", "fields": {"is_active": true, "courses": [1]}}]
[{"model": "api.dockerimage", "pk": 1, "fields": {"name": "far.gif", "file": "/population/huge/other/identify", "owner": "15", "public": true}}, {"model": "api.dockerimage", "pk": 2, "fields": {"name": "heart.gif", "file": "/treat/enjoy", "owner": "4", "public": true}}, {"model": "api.dockerimage", "pk": 3, "fields": {"name": "price.tiff", "file": "/thus/teacher/heart", "owner": "15", "public": true}}, {"model": "api.dockerimage", "pk": 4, "fields": {"name": "strategy.jpg", "file": "/always/a/born/wonder/yes", "owner": "12", "public": true}}, {"model": "api.dockerimage", "pk": 5, "fields": {"name": "religious.bmp", "file": "/every/great/whom", "owner": "10", "public": true}}, {"model": "api.fileextension", "pk": 1, "fields": {"extension": "bmp"}}, {"model": "api.fileextension", "pk": 2, "fields": {"extension": "gif"}}, {"model": "api.fileextension", "pk": 3, "fields": {"extension": "xls"}}, {"model": "api.fileextension", "pk": 4, "fields": {"extension": "mp4"}}, {"model": "api.fileextension", "pk": 5, "fields": {"extension": "wav"}}, {"model": "api.course", "pk": 1, "fields": {"name": "Stand-alone incremental function", "academic_startyear": 2024, "description": "Perform draw exactly they. Learn fact find read lay include.", "faculty": "Ingenieurswetenschappen_Architectuur", "parent_course": null}}, {"model": "api.course", "pk": 2, "fields": {"name": "Universal client-driven architecture", "academic_startyear": 2025, "description": "Peace sound shake ever current give.", "faculty": "Letteren_Wijsbegeerte", "parent_course": null}}, {"model": "api.course", "pk": 3, "fields": {"name": "Adaptive system-worthy instruction set", "academic_startyear": 2023, "description": "Wait specific new consider. Get natural early step their third there. A resource green follow mother.", "faculty": "Bio-ingenieurswetenschappen", "parent_course": null}}, {"model": "api.project", "pk": 1, "fields": {"name": "Organized grid-enabled analyzer", "description": "Process leave character improve almost something western. Character cut remain energy prepare political.", "visible": true, "archived": false, "locked_groups": false, "start_date": "2024-03-12T21:31:28.243Z", "deadline": "2024-05-22T21:31:28.243Z", "max_score": 72, "score_visible": false, "group_size": 15, "course": 1}}, {"model": "api.project", "pk": 2, "fields": {"name": "Front-line system-worthy database", "description": "Every stand memory machine culture expect reduce record. Actually because happy again admit. Serious feel property accept century up.", "visible": true, "archived": false, "locked_groups": true, "start_date": "2024-01-18T21:31:28.243Z", "deadline": "2024-06-22T21:31:28.243Z", "max_score": 47, "score_visible": true, "group_size": 9, "course": 3}}, {"model": "api.project", "pk": 3, "fields": {"name": "Integrated encompassing utilization", "description": "Area detail ahead win. Civil according she peace something front that lot. None food none structure want will.", "visible": true, "archived": false, "locked_groups": false, "start_date": "2024-01-19T21:31:28.243Z", "deadline": "2024-07-06T21:31:28.243Z", "max_score": 75, "score_visible": true, "group_size": 3, "course": 1}}, {"model": "api.project", "pk": 4, "fields": {"name": "De-engineered interactive info-mediaries", "description": "Central pull boy address feel recognize eat. Couple radio glass special free. Ago present air doctor husband worker beat attention. Like fight data lose south same summer population.", "visible": true, "archived": false, "locked_groups": false, "start_date": "2024-05-25T21:31:28.243Z", "deadline": "2024-06-22T21:31:28.243Z", "max_score": 50, "score_visible": false, "group_size": 13, "course": 2}}, {"model": "api.structurecheck", "pk": 0, "fields": {"name": "/go/hear/believe/role/alone/determine", "project": 3, "obligated_extensions": [2, 3, 4], "blocked_extensions": [4]}}, {"model": "api.structurecheck", "pk": 1, "fields": {"name": "/enough/model/station", "project": 3, "obligated_extensions": [3], "blocked_extensions": [2, 3, 5]}}, {"model": "api.extracheck", "pk": 1, "fields": {"project": 4, "docker_image": 1, "file": "/concern/energy/trouble/kitchen/suggest", "timeout": 276, "show_log": true}}, {"model": "api.student", "pk": "0", "fields": {"is_active": true, "student_id": "0", "courses": [1]}}, {"model": "api.student", "pk": "1", "fields": {"is_active": true, "student_id": "1", "courses": [1]}}, {"model": "api.student", "pk": "2", "fields": {"is_active": true, "student_id": "2", "courses": [1]}}, {"model": "api.student", "pk": "3", "fields": {"is_active": true, "student_id": "3", "courses": [1]}}, {"model": "api.student", "pk": "4", "fields": {"is_active": true, "student_id": "4", "courses": [1]}}, {"model": "api.student", "pk": "5", "fields": {"is_active": true, "student_id": "5", "courses": [1]}}, {"model": "api.student", "pk": "6", "fields": {"is_active": true, "student_id": "6", "courses": [1]}}, {"model": "api.student", "pk": "7", "fields": {"is_active": true, "student_id": "7", "courses": [1]}}, {"model": "api.student", "pk": "8", "fields": {"is_active": true, "student_id": "8", "courses": [1]}}, {"model": "api.student", "pk": "9", "fields": {"is_active": true, "student_id": "9", "courses": [1]}}, {"model": "api.group", "pk": 1, "fields": {"project": 3, "score": 50.0, "students": []}}, {"model": "api.group", "pk": 2, "fields": {"project": 1, "score": 8.0, "students": ["0", "1", "4", "5"]}}, {"model": "api.group", "pk": 3, "fields": {"project": 1, "score": 7.0, "students": ["2", "3", "6", "7"]}}, {"model": "api.group", "pk": 4, "fields": {"project": 2, "score": 5.0, "students": []}}, {"model": "api.group", "pk": 5, "fields": {"project": 3, "score": 18.0, "students": []}}, {"model": "api.group", "pk": 6, "fields": {"project": 1, "score": 66.0, "students": []}}, {"model": "api.group", "pk": 7, "fields": {"project": 1, "score": 34.0, "students": ["8", "9"]}}, {"model": "api.submission", "pk": 1, "fields": {"group": 1, "submission_number": null, "submission_time": "2024-04-03T00:00:00Z", "is_valid": true}}, {"model": "api.submission", "pk": 2, "fields": {"group": 5, "submission_number": null, "submission_time": "2024-04-06T00:00:00Z", "is_valid": true}}, {"model": "api.submission", "pk": 3, "fields": {"group": 6, "submission_number": null, "submission_time": "2024-04-15T00:00:00Z", "is_valid": true}}, {"model": "api.submission", "pk": 4, "fields": {"group": 1, "submission_number": null, "submission_time": "2024-04-11T00:00:00Z", "is_valid": true}}, {"model": "api.submission", "pk": 5, "fields": {"group": 7, "submission_number": null, "submission_time": "2024-04-09T00:00:00Z", "is_valid": true}}, {"model": "api.submission", "pk": 6, "fields": {"group": 6, "submission_number": null, "submission_time": "2024-04-07T00:00:00Z", "is_valid": true}}, {"model": "api.submission", "pk": 7, "fields": {"group": 3, "submission_number": null, "submission_time": "2024-04-12T00:00:00Z", "is_valid": true}}, {"model": "api.submission", "pk": 8, "fields": {"group": 4, "submission_number": null, "submission_time": "2024-04-05T00:00:00Z", "is_valid": true}}, {"model": "api.submission", "pk": 9, "fields": {"group": 5, "submission_number": null, "submission_time": "2024-04-09T00:00:00Z", "is_valid": true}}, {"model": "api.submission", "pk": 10, "fields": {"group": 6, "submission_number": null, "submission_time": "2024-04-04T00:00:00Z", "is_valid": true}}, {"model": "api.submissionfile", "pk": 1, "fields": {"submission": 10, "file": "/unit/political/training/control.jpg"}}, {"model": "api.checkresult", "pk": 289528, "fields": {"polymorphic_ctype": null, "submission": 9, "result": "FAILED", "error_message": "OBLIGATED_EXTENSION_NOT_FOUND"}}, {"model": "api.checkresult", "pk": 331891, "fields": {"polymorphic_ctype": null, "submission": 4, "result": "QUEUED", "error_message": null}}, {"model": "api.checkresult", "pk": 482730, "fields": {"polymorphic_ctype": null, "submission": 2, "result": "RUNNING", "error_message": null}}, {"model": "api.checkresult", "pk": 753267, "fields": {"polymorphic_ctype": null, "submission": 1, "result": "SUCCESS", "error_message": null}}, {"model": "api.checkresult", "pk": 762341, "fields": {"polymorphic_ctype": null, "submission": 2, "result": "FAILED", "error_message": "BLOCKED_EXTENSION"}}, {"model": "api.checkresult", "pk": 879866, "fields": {"polymorphic_ctype": null, "submission": 4, "result": "RUNNING", "error_message": null}}, {"model": "api.checkresult", "pk": 899073, "fields": {"polymorphic_ctype": null, "submission": 9, "result": "SUCCESS", "error_message": null}}, {"model": "api.checkresult", "pk": 906214, "fields": {"polymorphic_ctype": null, "submission": 1, "result": "QUEUED", "error_message": null}}, {"model": "api.structurecheckresult", "pk": 289528, "fields": {"structure_check": 1}}, {"model": "api.structurecheckresult", "pk": 331891, "fields": {"structure_check": 0}}, {"model": "api.structurecheckresult", "pk": 482730, "fields": {"structure_check": 0}}, {"model": "api.structurecheckresult", "pk": 753267, "fields": {"structure_check": 0}}, {"model": "api.structurecheckresult", "pk": 762341, "fields": {"structure_check": 1}}, {"model": "api.structurecheckresult", "pk": 879866, "fields": {"structure_check": 1}}, {"model": "api.structurecheckresult", "pk": 899073, "fields": {"structure_check": 0}}, {"model": "api.structurecheckresult", "pk": 906214, "fields": {"structure_check": 1}}, {"model": "api.assistant", "pk": "10", "fields": {"is_active": true, "courses": [2]}}, {"model": "api.assistant", "pk": "11", "fields": {"is_active": true, "courses": [2]}}, {"model": "api.assistant", "pk": "12", "fields": {"is_active": true, "courses": [1]}}, {"model": "api.assistant", "pk": "13", "fields": {"is_active": true, "courses": [1]}}, {"model": "api.assistant", "pk": "14", "fields": {"is_active": true, "courses": [1]}}, {"model": "api.teacher", "pk": "15", "fields": {"is_active": true, "courses": [1]}}, {"model": "api.teacher", "pk": "16", "fields": {"is_active": true, "courses": [1]}}, {"model": "api.teacher", "pk": "17", "fields": {"is_active": true, "courses": [2]}}]
9 changes: 4 additions & 5 deletions backend/api/management/commands/seed_db.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import time
from random import choices, randint, seed
from random import choices, randint

from api.models.assistant import Assistant
from api.models.course import Course
from api.models.group import Group
from api.models.project import Project
from api.models.student import Student
from api.models.submission import Submission
from api.models.teacher import Teacher
from api.seeders.faker import faker
from api.seeders.seeder import (fillFaculties, seed_assistants, seed_courses,
Expand All @@ -16,7 +15,7 @@
seed_students, seed_submission_files,
seed_submission_results, seed_submissions,
seed_teachers)
from authentication.models import Faculty, User
from authentication.models import User
from django.core.management import call_command
from django.core.management.base import BaseCommand

Expand Down Expand Up @@ -126,7 +125,7 @@ def handle(self, *args, **options):
amount_of_courses = 250
amount_of_projects = 500
amount_of_groups = 500
amount_of_file_extensions = 50
amount_of_file_extensions = 32 # Max amount of file extensions in Faker
amount_of_docker_images = 50
amount_of_structure_checks = 250
amount_of_extra_checks = 125
Expand All @@ -139,7 +138,7 @@ def handle(self, *args, **options):
amount_of_courses = 1_500
amount_of_projects = 3_000
amount_of_groups = 3_000
amount_of_file_extensions = 50
amount_of_file_extensions = 32 # Max amount of file extensions in Faker
amount_of_docker_images = 50
amount_of_structure_checks = 1_500
amount_of_extra_checks = 750
Expand Down
2 changes: 0 additions & 2 deletions backend/api/seeders/seeder.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from functools import wraps
from random import choice, randint, sample
from re import sub
from time import time
from unicodedata import category

from django.db import connection
from django.utils import timezone
Expand Down
2 changes: 1 addition & 1 deletion backend/authentication/fixtures/large/large.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion backend/authentication/fixtures/medium/medium.json

Large diffs are not rendered by default.

Loading

0 comments on commit b934c4b

Please sign in to comment.