From 94f58e2b862912a11aba52ffe87238a207d09f21 Mon Sep 17 00:00:00 2001
From: Ernesto Rico Schmidt <ernesto@helsinki.at>
Date: Tue, 14 May 2024 11:59:09 -0400
Subject: [PATCH] test: add fixtures for category, language, link_type,
 music_focus, topic and owner

---
 conftest.py | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/conftest.py b/conftest.py
index 8a0c44e0..addadf79 100644
--- a/conftest.py
+++ b/conftest.py
@@ -6,26 +6,37 @@ from rest_framework.test import APIClient
 from django.contrib.auth.models import Permission, User
 from django.core.files.uploadedfile import SimpleUploadedFile
 from program.models import (
+    Category,
     FundingCategory,
     Host,
     Image,
+    Language,
     License,
+    LinkType,
+    MusicFocus,
     RRule,
     Schedule,
     Show,
     TimeSlot,
+    Topic,
     Type,
 )
 from program.tests.factories import (
+    CategoryFactory,
     CommonUserFactory,
     FundingCategoryFactory,
     HostFactory,
     ImageFactory,
+    LanguageFactory,
     LicenseFactory,
+    LinkTypeFactory,
+    MusicFocusFactory,
+    OwnerFactory,
     RRuleFactory,
     ScheduleFactory,
     ShowFactory,
     TimeslotFactory,
+    TopicFactory,
     TypeFactory,
     UserWithPermissionsFactory,
 )
@@ -39,6 +50,8 @@ def assert_data(response, data) -> None:
         for key, value in data.items():
             if key == "password":
                 continue
+            elif key == "links":
+                assert response.data["links"] == data["links"]
             assert response.data[key] == value
 
 
@@ -208,3 +221,33 @@ def funding_category() -> FundingCategory:
 @pytest.fixture
 def type_() -> Type:
     return TypeFactory()
+
+
+@pytest.fixture
+def category() -> Category:
+    return CategoryFactory()
+
+
+@pytest.fixture
+def language() -> Language:
+    return LanguageFactory()
+
+
+@pytest.fixture
+def link_type() -> LinkType:
+    return LinkTypeFactory(name="Website")
+
+
+@pytest.fixture
+def music_focus() -> MusicFocus:
+    return MusicFocusFactory()
+
+
+@pytest.fixture
+def topic() -> Topic:
+    return TopicFactory()
+
+
+@pytest.fixture
+def owner() -> User:
+    return OwnerFactory()
-- 
GitLab