Add test data
This commit is contained in:
parent
0a4bbb0df7
commit
f24fd040f9
|
|
@ -21,7 +21,6 @@ import type {
|
||||||
XlsExportRequestData,
|
XlsExportRequestData,
|
||||||
XlsExportResponseData,
|
XlsExportResponseData,
|
||||||
} from "@/types";
|
} from "@/types";
|
||||||
import type dayjs from "dayjs";
|
|
||||||
|
|
||||||
export type DashboardPersonRoleType =
|
export type DashboardPersonRoleType =
|
||||||
| "SUPERVISOR"
|
| "SUPERVISOR"
|
||||||
|
|
|
||||||
|
|
@ -26,9 +26,10 @@ TEST_STUDENT2_USER_ID = "19c40d94-15cc-4198-aaad-ef707c4b0900"
|
||||||
TEST_STUDENT3_USER_ID = "bcf94dba-53bc-474b-a22d-e4af39aa042b"
|
TEST_STUDENT3_USER_ID = "bcf94dba-53bc-474b-a22d-e4af39aa042b"
|
||||||
TEST_MENTOR1_USER_ID = "d1f5f5a9-5b0a-4e1a-9e1a-9e9b5b5e1b1b"
|
TEST_MENTOR1_USER_ID = "d1f5f5a9-5b0a-4e1a-9e1a-9e9b5b5e1b1b"
|
||||||
TEST_BERUFSBILDNER1_USER_ID = "bb83dde0-27e7-4859-8acb-a323025d712c"
|
TEST_BERUFSBILDNER1_USER_ID = "bb83dde0-27e7-4859-8acb-a323025d712c"
|
||||||
TEST_LERNBEGLEITER1_USER_ID = "ffeedde0-27e7-ff59-8aff-a3230ffd712c"
|
TEST_AUSBILDUNGSVERANTWORTLICHER1_USER_ID = "ffeedde0-27e7-ff59-8aff-a3230ffd712c"
|
||||||
TEST_STUDENT1_VV_USER_ID = "5ff59857-8de5-415e-a387-4449f9a0337a"
|
TEST_STUDENT1_VV_USER_ID = "5ff59857-8de5-415e-a387-4449f9a0337a"
|
||||||
TEST_STUDENT2_VV_AND_VV_MENTOR_USER_ID = "7e8ebf0b-e6e2-4022-88f4-6e663ba0a9db"
|
TEST_STUDENT2_VV_AND_VV_MENTOR_USER_ID = "7e8ebf0b-e6e2-4022-88f4-6e663ba0a9db"
|
||||||
|
TEST_STUDENT3_VV_USER_ID = "ba8ebf0b-9de5-215e-a387-4449f9aa337b"
|
||||||
TEST_USER_EMPTY_ID = "daecbabe-4ab9-4edf-a71f-4119042ccb02"
|
TEST_USER_EMPTY_ID = "daecbabe-4ab9-4edf-a71f-4119042ccb02"
|
||||||
TEST_USER_DATATRANS_HANNA_ID = "6bec1a0d-f852-47aa-a4de-072df6e07ad1"
|
TEST_USER_DATATRANS_HANNA_ID = "6bec1a0d-f852-47aa-a4de-072df6e07ad1"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,14 +6,15 @@ from environs import Env
|
||||||
|
|
||||||
from vbv_lernwelt.core.constants import (
|
from vbv_lernwelt.core.constants import (
|
||||||
ADMIN_USER_ID,
|
ADMIN_USER_ID,
|
||||||
|
TEST_AUSBILDUNGSVERANTWORTLICHER1_USER_ID,
|
||||||
TEST_BERUFSBILDNER1_USER_ID,
|
TEST_BERUFSBILDNER1_USER_ID,
|
||||||
TEST_LERNBEGLEITER1_USER_ID,
|
|
||||||
TEST_MENTOR1_USER_ID,
|
TEST_MENTOR1_USER_ID,
|
||||||
TEST_STUDENT1_USER_ID,
|
TEST_STUDENT1_USER_ID,
|
||||||
TEST_STUDENT1_VV_USER_ID,
|
TEST_STUDENT1_VV_USER_ID,
|
||||||
TEST_STUDENT2_USER_ID,
|
TEST_STUDENT2_USER_ID,
|
||||||
TEST_STUDENT2_VV_AND_VV_MENTOR_USER_ID,
|
TEST_STUDENT2_VV_AND_VV_MENTOR_USER_ID,
|
||||||
TEST_STUDENT3_USER_ID,
|
TEST_STUDENT3_USER_ID,
|
||||||
|
TEST_STUDENT3_VV_USER_ID,
|
||||||
TEST_SUPERVISOR1_USER_ID,
|
TEST_SUPERVISOR1_USER_ID,
|
||||||
TEST_TRAINER1_USER_ID,
|
TEST_TRAINER1_USER_ID,
|
||||||
TEST_TRAINER2_USER_ID,
|
TEST_TRAINER2_USER_ID,
|
||||||
|
|
@ -256,6 +257,7 @@ def create_default_users(default_password="test", set_avatar=False):
|
||||||
last_name="Vollgas",
|
last_name="Vollgas",
|
||||||
)
|
)
|
||||||
_create_student_user(
|
_create_student_user(
|
||||||
|
id=TEST_STUDENT3_VV_USER_ID,
|
||||||
email="patrizia.huggel@eiger-versicherungen.ch",
|
email="patrizia.huggel@eiger-versicherungen.ch",
|
||||||
first_name="Patrizia",
|
first_name="Patrizia",
|
||||||
last_name="Huggel",
|
last_name="Huggel",
|
||||||
|
|
@ -421,10 +423,10 @@ def create_default_users(default_password="test", set_avatar=False):
|
||||||
avatar_image="uk1.patrizia.huggel.jpg",
|
avatar_image="uk1.patrizia.huggel.jpg",
|
||||||
)
|
)
|
||||||
_create_user(
|
_create_user(
|
||||||
_id=TEST_LERNBEGLEITER1_USER_ID,
|
_id=TEST_AUSBILDUNGSVERANTWORTLICHER1_USER_ID,
|
||||||
email="test-lernbegleiter1@example.com",
|
email="test-lernbegleiter1@example.com",
|
||||||
first_name="Bruno",
|
first_name="Bruno",
|
||||||
last_name="Banani-Lernbegleiter",
|
last_name="Banani-Ausbildungsverantwortlicher",
|
||||||
password=default_password,
|
password=default_password,
|
||||||
language="de",
|
language="de",
|
||||||
avatar_image="uk1.patrizia.huggel.jpg",
|
avatar_image="uk1.patrizia.huggel.jpg",
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ def delete_cs_data(cs: CourseSession):
|
||||||
CourseSessionEdoniqTest.objects.filter(course_session=cs).delete()
|
CourseSessionEdoniqTest.objects.filter(course_session=cs).delete()
|
||||||
CourseSessionUser.objects.filter(course_session=cs).delete()
|
CourseSessionUser.objects.filter(course_session=cs).delete()
|
||||||
|
|
||||||
AgentParticipantRelation.objects.filter(course_session=cs).delete()
|
AgentParticipantRelation.objects.filter(participant__course_session=cs).delete()
|
||||||
else:
|
else:
|
||||||
logger.info("no_course_session_found", import_id=cs.import_id)
|
logger.info("no_course_session_found", import_id=cs.import_id)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,12 @@ from vbv_lernwelt.competence.create_vv_new_competence_profile import (
|
||||||
create_vv_new_competence_profile,
|
create_vv_new_competence_profile,
|
||||||
)
|
)
|
||||||
from vbv_lernwelt.competence.models import PerformanceCriteria
|
from vbv_lernwelt.competence.models import PerformanceCriteria
|
||||||
from vbv_lernwelt.core.constants import TEST_STUDENT2_VV_AND_VV_MENTOR_USER_ID
|
from vbv_lernwelt.core.constants import (
|
||||||
|
TEST_AUSBILDUNGSVERANTWORTLICHER1_USER_ID,
|
||||||
|
TEST_STUDENT1_VV_USER_ID,
|
||||||
|
TEST_STUDENT2_VV_AND_VV_MENTOR_USER_ID,
|
||||||
|
TEST_STUDENT3_VV_USER_ID,
|
||||||
|
)
|
||||||
from vbv_lernwelt.core.create_default_users import default_users
|
from vbv_lernwelt.core.create_default_users import default_users
|
||||||
from vbv_lernwelt.core.models import User
|
from vbv_lernwelt.core.models import User
|
||||||
from vbv_lernwelt.course.consts import (
|
from vbv_lernwelt.course.consts import (
|
||||||
|
|
@ -92,6 +97,14 @@ from vbv_lernwelt.importer.services import (
|
||||||
import_students_from_excel,
|
import_students_from_excel,
|
||||||
import_trainers_from_excel_for_training,
|
import_trainers_from_excel_for_training,
|
||||||
)
|
)
|
||||||
|
from vbv_lernwelt.learning_mentor.models import (
|
||||||
|
AgentParticipantRelation,
|
||||||
|
AgentParticipantRoleType,
|
||||||
|
)
|
||||||
|
from vbv_lernwelt.learnpath.consts import (
|
||||||
|
COURSE_PROFILE_NICHTLEBEN_CODE,
|
||||||
|
COURSE_PROFILE_NICHTLEBEN_ID,
|
||||||
|
)
|
||||||
from vbv_lernwelt.learnpath.create_vv_new_learning_path import (
|
from vbv_lernwelt.learnpath.create_vv_new_learning_path import (
|
||||||
create_vv_motorfahrzeug_pruefung_learning_path,
|
create_vv_motorfahrzeug_pruefung_learning_path,
|
||||||
create_vv_new_learning_path,
|
create_vv_new_learning_path,
|
||||||
|
|
@ -100,6 +113,7 @@ from vbv_lernwelt.learnpath.create_vv_new_learning_path import (
|
||||||
from vbv_lernwelt.learnpath.creators import assign_circles_to_profiles
|
from vbv_lernwelt.learnpath.creators import assign_circles_to_profiles
|
||||||
from vbv_lernwelt.learnpath.models import (
|
from vbv_lernwelt.learnpath.models import (
|
||||||
Circle,
|
Circle,
|
||||||
|
CourseProfile,
|
||||||
LearningContent,
|
LearningContent,
|
||||||
LearningContentAssignment,
|
LearningContentAssignment,
|
||||||
LearningContentAttendanceCourse,
|
LearningContentAttendanceCourse,
|
||||||
|
|
@ -113,6 +127,7 @@ from vbv_lernwelt.media_files.create_default_images import create_default_images
|
||||||
from vbv_lernwelt.media_library.create_default_media_library import (
|
from vbv_lernwelt.media_library.create_default_media_library import (
|
||||||
create_default_media_library,
|
create_default_media_library,
|
||||||
)
|
)
|
||||||
|
from vbv_lernwelt.shop.tests.factories import CheckoutInformationFactory
|
||||||
|
|
||||||
ADMIN_EMAILS = ["info@iterativ.ch", "admin"]
|
ADMIN_EMAILS = ["info@iterativ.ch", "admin"]
|
||||||
|
|
||||||
|
|
@ -239,13 +254,22 @@ def create_versicherungsvermittlerin_course(
|
||||||
|
|
||||||
student_1_csu = CourseSessionUser.objects.create(
|
student_1_csu = CourseSessionUser.objects.create(
|
||||||
course_session=cs,
|
course_session=cs,
|
||||||
user=User.objects.get(username="student-vv@eiger-versicherungen.ch"),
|
user=User.objects.get(id=TEST_STUDENT1_VV_USER_ID),
|
||||||
)
|
)
|
||||||
mentor_and_student_2_learning_csu = CourseSessionUser.objects.create(
|
mentor_and_student_2_learning_csu = CourseSessionUser.objects.create(
|
||||||
course_session=cs,
|
course_session=cs,
|
||||||
user=User.objects.get(id=TEST_STUDENT2_VV_AND_VV_MENTOR_USER_ID),
|
user=User.objects.get(id=TEST_STUDENT2_VV_AND_VV_MENTOR_USER_ID),
|
||||||
role=CourseSessionUser.Role.MEMBER,
|
role=CourseSessionUser.Role.MEMBER,
|
||||||
)
|
)
|
||||||
|
student_3_csu = CourseSessionUser.objects.create(
|
||||||
|
course_session=cs,
|
||||||
|
user=User.objects.get(id=TEST_STUDENT3_VV_USER_ID),
|
||||||
|
chosen_profile=CourseProfile.objects.get_or_create(
|
||||||
|
id=COURSE_PROFILE_NICHTLEBEN_ID,
|
||||||
|
code=COURSE_PROFILE_NICHTLEBEN_CODE,
|
||||||
|
order=3,
|
||||||
|
)[0],
|
||||||
|
)
|
||||||
|
|
||||||
CourseSessionUser.objects.create(
|
CourseSessionUser.objects.create(
|
||||||
course_session=cs,
|
course_session=cs,
|
||||||
|
|
@ -270,6 +294,23 @@ def create_versicherungsvermittlerin_course(
|
||||||
course_session=cs,
|
course_session=cs,
|
||||||
user=User.objects.get(email=admin_email),
|
user=User.objects.get(email=admin_email),
|
||||||
)
|
)
|
||||||
|
# Ausbildungsverantwortlicher
|
||||||
|
AgentParticipantRelation.objects.create(
|
||||||
|
agent=User.objects.get(id=TEST_AUSBILDUNGSVERANTWORTLICHER1_USER_ID),
|
||||||
|
participant=student_1_csu,
|
||||||
|
role=AgentParticipantRoleType.BERUFSBILDNER.value,
|
||||||
|
)
|
||||||
|
AgentParticipantRelation.objects.create(
|
||||||
|
agent=User.objects.get(id=TEST_AUSBILDUNGSVERANTWORTLICHER1_USER_ID),
|
||||||
|
participant=student_3_csu,
|
||||||
|
role=AgentParticipantRoleType.BERUFSBILDNER.value,
|
||||||
|
)
|
||||||
|
CheckoutInformationFactory(
|
||||||
|
user=User.objects.get(id=TEST_STUDENT1_VV_USER_ID),
|
||||||
|
)
|
||||||
|
CheckoutInformationFactory(
|
||||||
|
user=User.objects.get(id=TEST_STUDENT3_VV_USER_ID),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def create_versicherungsvermittlerin_pruefung_course(
|
def create_versicherungsvermittlerin_pruefung_course(
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
# Generated by Django 4.2.13 on 2024-09-12 13:40
|
# Generated by Django 4.2.13 on 2024-09-12 13:40
|
||||||
|
|
||||||
|
import django.db.models.deletion
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import migrations, models
|
from django.db import migrations, models
|
||||||
import django.db.models.deletion
|
|
||||||
|
|
||||||
|
|
||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue