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
bb088cbd
Verified
Commit
bb088cbd
authored
9 months ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
test: add factory for Radio Settings and fixtures
parent
451079fd
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
+19
-0
19 additions, 0 deletions
conftest.py
program/tests/factories.py
+6
-0
6 additions, 0 deletions
program/tests/factories.py
with
25 additions
and
0 deletions
conftest.py
+
19
−
0
View file @
bb088cbd
...
...
@@ -14,6 +14,7 @@ from program.models import (
License
,
LinkType
,
MusicFocus
,
RadioSettings
,
RRule
,
Schedule
,
Show
,
...
...
@@ -32,6 +33,7 @@ from program.tests.factories import (
LinkTypeFactory
,
MusicFocusFactory
,
OwnerFactory
,
RadioSettingsFactory
,
RRuleFactory
,
ScheduleFactory
,
ShowFactory
,
...
...
@@ -154,11 +156,28 @@ def once_rrule() -> RRule:
return
RRuleFactory
(
freq
=
0
)
@pytest.fixture
def
daily_rrule
()
->
RRule
:
return
RRuleFactory
(
freq
=
3
)
@pytest.fixture
def
show
()
->
Show
:
return
ShowFactory
()
@pytest.fixture
def
fallback_show
()
->
Show
:
return
ShowFactory
(
name
=
"
Musikpool
"
)
@pytest.fixture
def
radio_settings
(
fallback_show
)
->
RadioSettings
:
return
RadioSettingsFactory
(
fallback_default_pool
=
"
Musikpool
"
,
fallback_show
=
fallback_show
,
station_name
=
"
Radio AURA
"
)
@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
+
6
−
0
View file @
bb088cbd
...
...
@@ -16,6 +16,7 @@ from program.models import (
LinkType
,
MusicFocus
,
Note
,
RadioSettings
,
RRule
,
Schedule
,
Show
,
...
...
@@ -152,3 +153,8 @@ class TopicFactory(DjangoModelFactory):
class
OwnerFactory
(
DjangoModelFactory
):
class
Meta
:
model
=
User
class
RadioSettingsFactory
(
DjangoModelFactory
):
class
Meta
:
model
=
RadioSettings
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