Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
steering
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AURA
steering
Commits
2e21156e
Verified
Commit
2e21156e
authored
6 months ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
test: add CBA factory and fixture
parent
40b27376
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
conftest.py
+7
-0
7 additions, 0 deletions
conftest.py
program/tests/factories.py
+9
-0
9 additions, 0 deletions
program/tests/factories.py
with
16 additions
and
0 deletions
conftest.py
+
7
−
0
View file @
2e21156e
...
...
@@ -6,6 +6,7 @@ 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
(
CBA
,
Category
,
FundingCategory
,
Image
,
...
...
@@ -24,6 +25,7 @@ from program.models import (
)
from
program.tests.factories
import
(
CategoryFactory
,
CBAFactory
,
CommonUserFactory
,
FundingCategoryFactory
,
ImageFactory
,
...
...
@@ -202,6 +204,11 @@ def radio_settings(fallback_show) -> RadioSettings:
)
@pytest.fixture
def
cba
(
common_user1
)
->
CBA
:
return
CBAFactory
(
user
=
common_user1
)
@pytest.fixture
def
owned_show
(
common_user1
,
show
)
->
Show
:
"""
Show owned by a common user
"""
...
...
This diff is collapsed.
Click to expand it.
program/tests/factories.py
+
9
−
0
View file @
2e21156e
...
...
@@ -7,6 +7,7 @@ from django.contrib.auth.models import Permission, User
from
django.db.models
import
QuerySet
from
django.utils.timezone
import
now
from
program.models
import
(
CBA
,
Category
,
FundingCategory
,
Image
,
...
...
@@ -158,3 +159,11 @@ class OwnerFactory(DjangoModelFactory):
class
RadioSettingsFactory
(
DjangoModelFactory
):
class
Meta
:
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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment