Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
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
David Marzal
funkwhale
Commits
d7adaf39
Verified
Commit
d7adaf39
authored
7 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Can now use nodb_factory fixtue in tests for faster tests
parent
367014f7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/tests/conftest.py
+13
-0
13 additions, 0 deletions
api/tests/conftest.py
with
13 additions
and
0 deletions
api/tests/conftest.py
+
13
−
0
View file @
d7adaf39
import
factory
import
tempfile
import
shutil
import
pytest
from
django.core.cache
import
cache
as
django_cache
from
dynamic_preferences.registries
import
global_preferences_registry
from
rest_framework.test
import
APIClient
from
rest_framework.test
import
APIRequestFactory
...
...
@@ -27,6 +30,16 @@ def cache():
@pytest.fixture
def
factories
(
db
):
from
funkwhale_api
import
factories
for
v
in
factories
.
registry
.
values
():
v
.
_meta
.
strategy
=
factory
.
CREATE_STRATEGY
yield
factories
.
registry
@pytest.fixture
def
nodb_factories
():
from
funkwhale_api
import
factories
for
v
in
factories
.
registry
.
values
():
v
.
_meta
.
strategy
=
factory
.
BUILD_STRATEGY
yield
factories
.
registry
...
...
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