Commit a95d5f68 authored by Maxime Emschwiller's avatar Maxime Emschwiller
Browse files

feature(backend): Add function to create dummy partner

parent d9920f7a
......@@ -3,6 +3,7 @@ from django.test import TestCase
from rest_framework.test import APIClient
from backend_app.models.country import Country
from backend_app.models.partner import Partner
from backend_app.models.university import University
from base_app.models import User
......@@ -95,7 +96,7 @@ def get_dummy_country() -> Country:
def get_dummy_university(id: int = 1) -> University:
return University.objects.update_or_create(
univ = University.objects.update_or_create(
name=f"Université de Technologie de Compiègne_{id}",
defaults=dict(
acronym="UTC",
......@@ -105,3 +106,16 @@ def get_dummy_university(id: int = 1) -> University:
city="",
),
)[0]
# Also set up partner info, to complete the circle
partner = get_dummy_partner(id)
partner.university = univ
partner.save()
return univ
def get_dummy_partner(id: int = 1) -> Partner:
return Partner.objects.update_or_create(
univ_name=f"Université de Technologie de Compiègne_{id}",
utc_id=id,
defaults=dict(iso_code="ab", country="osef", city=""),
)[0]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment