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

test: add CBA factory and fixture

parent 40b27376
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,7 @@ from rest_framework.test import APIClient ...@@ -6,6 +6,7 @@ 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 (
CBA,
Category, Category,
FundingCategory, FundingCategory,
Image, Image,
...@@ -24,6 +25,7 @@ from program.models import ( ...@@ -24,6 +25,7 @@ from program.models import (
) )
from program.tests.factories import ( from program.tests.factories import (
CategoryFactory, CategoryFactory,
CBAFactory,
CommonUserFactory, CommonUserFactory,
FundingCategoryFactory, FundingCategoryFactory,
ImageFactory, ImageFactory,
...@@ -202,6 +204,11 @@ def radio_settings(fallback_show) -> RadioSettings: ...@@ -202,6 +204,11 @@ def radio_settings(fallback_show) -> RadioSettings:
) )
@pytest.fixture
def cba(common_user1) -> CBA:
return CBAFactory(user=common_user1)
@pytest.fixture @pytest.fixture
def owned_show(common_user1, show) -> Show: def owned_show(common_user1, show) -> Show:
"""Show owned by a common user""" """Show owned by a common user"""
......
...@@ -7,6 +7,7 @@ from django.contrib.auth.models import Permission, User ...@@ -7,6 +7,7 @@ from django.contrib.auth.models import Permission, User
from django.db.models import QuerySet from django.db.models import QuerySet
from django.utils.timezone import now from django.utils.timezone import now
from program.models import ( from program.models import (
CBA,
Category, Category,
FundingCategory, FundingCategory,
Image, Image,
...@@ -158,3 +159,11 @@ class OwnerFactory(DjangoModelFactory): ...@@ -158,3 +159,11 @@ class OwnerFactory(DjangoModelFactory):
class RadioSettingsFactory(DjangoModelFactory): class RadioSettingsFactory(DjangoModelFactory):
class Meta: class Meta:
model = RadioSettings model = RadioSettings
class CBAFactory(DjangoModelFactory):
class Meta:
model = CBA
username = Sequence(lambda n: "username_%d" % n)
user_token = Sequence(lambda n: "user_token_%d" % n)
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