alchemy flush and save functions updated
This commit is contained in:
@@ -1,24 +1,21 @@
|
||||
from test_application.evyos.bases import (
|
||||
requester,
|
||||
# select_company_uu_id,
|
||||
active_and_confirmed,
|
||||
)
|
||||
from test_application.evyos.people import (
|
||||
|
||||
from service_app_test.test_application.evyos.people import (
|
||||
create_random_person,
|
||||
create_random_user,
|
||||
create_random_occupant_user,
|
||||
)
|
||||
from test_application.evyos.datas.company_employee_data import (
|
||||
from service_app_test.test_application.evyos.datas.company_employee_data import (
|
||||
departments,
|
||||
duties,
|
||||
staffs,
|
||||
)
|
||||
from service_app_test.bases import active_and_confirmed
|
||||
|
||||
|
||||
print("Program up and running **-------------------------------------")
|
||||
|
||||
|
||||
def create_department_via_list(list_of_departments):
|
||||
def create_department_via_list(list_of_departments, requester):
|
||||
for department in list_of_departments:
|
||||
request_department = requester.post(
|
||||
data={
|
||||
@@ -30,7 +27,7 @@ def create_department_via_list(list_of_departments):
|
||||
print(request_department.json())
|
||||
|
||||
|
||||
def create_duty_via_list(list_of_duties):
|
||||
def create_duty_via_list(list_of_duties, requester):
|
||||
for duty in list_of_duties:
|
||||
duty_dict = {
|
||||
"duty_name": duty["duty_name"],
|
||||
@@ -42,7 +39,7 @@ def create_duty_via_list(list_of_duties):
|
||||
print(request_duty.json())
|
||||
|
||||
|
||||
def create_duties_via_list(list_of_duties, company_uu_id):
|
||||
def create_duties_via_list(list_of_duties, company_uu_id, requester):
|
||||
for duty in list_of_duties:
|
||||
department_response = requester.post(
|
||||
endpoint="department/list",
|
||||
@@ -68,7 +65,7 @@ def create_duties_via_list(list_of_duties, company_uu_id):
|
||||
)
|
||||
|
||||
|
||||
def create_staff_via_list(list_of_staff):
|
||||
def create_staff_via_list(list_of_staff, requester):
|
||||
for staff in list_of_staff:
|
||||
duty_response = requester.post(
|
||||
endpoint="duty/list",
|
||||
@@ -89,7 +86,7 @@ def create_staff_via_list(list_of_staff):
|
||||
print(request_staff.json())
|
||||
|
||||
|
||||
def create_employee_via_list(list_of_staff):
|
||||
def create_employee_via_list(list_of_staff, requester):
|
||||
for staff in list_of_staff:
|
||||
duty_response = requester.post(
|
||||
endpoint="duty/list",
|
||||
@@ -142,7 +139,7 @@ def create_employee_via_list(list_of_staff):
|
||||
print(request_staff.json())
|
||||
|
||||
|
||||
def create_people_via_list(people_count: int):
|
||||
def create_people_via_list(people_count: int, requester):
|
||||
for people in range(people_count):
|
||||
people = create_random_person()
|
||||
people_dict = people.model_dump()
|
||||
@@ -159,7 +156,7 @@ def create_people_via_list(people_count: int):
|
||||
selected_user_uu_id = response_user["data"]["uu_id"]
|
||||
|
||||
|
||||
def create_occupant_people_via_list(people_count: int):
|
||||
def create_occupant_people_via_list(people_count: int, requester):
|
||||
for people in range(people_count):
|
||||
people = create_random_person()
|
||||
people_dict = people.model_dump()
|
||||
@@ -176,14 +173,14 @@ def create_occupant_people_via_list(people_count: int):
|
||||
selected_user_uu_id = response_user["data"]["uu_id"]
|
||||
|
||||
|
||||
def run_company_and_depends(company_uu_id):
|
||||
create_department_via_list(list_of_departments=departments)
|
||||
create_duty_via_list(list_of_duties=duties)
|
||||
create_duties_via_list(list_of_duties=duties, company_uu_id=company_uu_id)
|
||||
create_staff_via_list(list_of_staff=staffs)
|
||||
create_employee_via_list(list_of_staff=duties)
|
||||
create_people_via_list(people_count=10)
|
||||
create_occupant_people_via_list(people_count=70)
|
||||
def run_company_and_depends(company_uu_id, requester):
|
||||
create_department_via_list(list_of_departments=departments, requester=requester)
|
||||
create_duty_via_list(list_of_duties=duties, requester=requester)
|
||||
create_duties_via_list(list_of_duties=duties, company_uu_id=company_uu_id, requester=requester)
|
||||
create_staff_via_list(list_of_staff=staffs, requester=requester)
|
||||
create_employee_via_list(list_of_staff=duties, requester=requester)
|
||||
create_people_via_list(people_count=10, requester=requester)
|
||||
create_occupant_people_via_list(people_count=70, requester=requester)
|
||||
|
||||
|
||||
print("Program ended **-------------------------------------")
|
||||
|
||||
Reference in New Issue
Block a user