diff --git a/conftest.py b/conftest.py index 8a0c44e0b7ec8227619806f839948f0e68c7a66d..addadf793d8573613ceb3a83a02aa847b0168d91 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()