Skip to content
Snippets Groups Projects
Verified Commit 94f58e2b authored by Ernesto Rico Schmidt's avatar Ernesto Rico Schmidt
Browse files

test: add fixtures for category, language, link_type, music_focus, topic and owner

parent fed0f017
No related branches found
No related tags found
No related merge requests found
...@@ -6,26 +6,37 @@ from rest_framework.test import APIClient ...@@ -6,26 +6,37 @@ from rest_framework.test import APIClient
from django.contrib.auth.models import Permission, User from django.contrib.auth.models import Permission, User
from django.core.files.uploadedfile import SimpleUploadedFile from django.core.files.uploadedfile import SimpleUploadedFile
from program.models import ( from program.models import (
Category,
FundingCategory, FundingCategory,
Host, Host,
Image, Image,
Language,
License, License,
LinkType,
MusicFocus,
RRule, RRule,
Schedule, Schedule,
Show, Show,
TimeSlot, TimeSlot,
Topic,
Type, Type,
) )
from program.tests.factories import ( from program.tests.factories import (
CategoryFactory,
CommonUserFactory, CommonUserFactory,
FundingCategoryFactory, FundingCategoryFactory,
HostFactory, HostFactory,
ImageFactory, ImageFactory,
LanguageFactory,
LicenseFactory, LicenseFactory,
LinkTypeFactory,
MusicFocusFactory,
OwnerFactory,
RRuleFactory, RRuleFactory,
ScheduleFactory, ScheduleFactory,
ShowFactory, ShowFactory,
TimeslotFactory, TimeslotFactory,
TopicFactory,
TypeFactory, TypeFactory,
UserWithPermissionsFactory, UserWithPermissionsFactory,
) )
...@@ -39,6 +50,8 @@ def assert_data(response, data) -> None: ...@@ -39,6 +50,8 @@ def assert_data(response, data) -> None:
for key, value in data.items(): for key, value in data.items():
if key == "password": if key == "password":
continue continue
elif key == "links":
assert response.data["links"] == data["links"]
assert response.data[key] == value assert response.data[key] == value
...@@ -208,3 +221,33 @@ def funding_category() -> FundingCategory: ...@@ -208,3 +221,33 @@ def funding_category() -> FundingCategory:
@pytest.fixture @pytest.fixture
def type_() -> Type: def type_() -> Type:
return TypeFactory() 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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment