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
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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment