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
79fcc3dd
Verified
Commit
79fcc3dd
authored
3 months ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
refactor: move owned_licensed_image fixture -> test_images
parent
5752964c
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
+0
-5
0 additions, 5 deletions
conftest.py
program/tests/test_images.py
+6
-1
6 additions, 1 deletion
program/tests/test_images.py
with
6 additions
and
6 deletions
conftest.py
+
0
−
5
View file @
79fcc3dd
...
...
@@ -104,11 +104,6 @@ def public_domain_license() -> License:
return
LicenseFactory
(
identifier
=
"
pd
"
,
name
=
"
Public Domain
"
)
@pytest.fixture
def
owned_licensed_image
(
image_file
,
common_user1
,
public_domain_license
)
->
Image
:
return
ImageFactory
(
image
=
image_file
,
owner
=
common_user1
,
license
=
LicenseFactory
())
@pytest.fixture
def
api_client
()
->
APIClient
:
"""
Unauthenticated API client
"""
...
...
This diff is collapsed.
Click to expand it.
program/tests/test_images.py
+
6
−
1
View file @
79fcc3dd
...
...
@@ -2,7 +2,7 @@ import pytest
from
conftest
import
assert_data
from
program.models
import
Image
from
program.tests.factories
import
ImageFactory
from
program.tests.factories
import
ImageFactory
,
LicenseFactory
pytestmark
=
pytest
.
mark
.
django_db
...
...
@@ -24,6 +24,11 @@ def owned_image(image_file, common_user1) -> Image:
return
ImageFactory
(
image
=
image_file
,
owner
=
common_user1
)
@pytest.fixture
def
owned_licensed_image
(
image_file
,
common_user1
,
public_domain_license
)
->
Image
:
return
ImageFactory
(
image
=
image_file
,
owner
=
common_user1
,
license
=
LicenseFactory
())
def
test_create_image
(
image_file
,
common_api_client1
):
data
=
{
"
image
"
:
image_file
}
...
...
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