Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
funkwhale_OLD
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
jovuit
funkwhale_OLD
Commits
22370d1b
Verified
Commit
22370d1b
authored
7 years ago
by
Eliot Berriot
Browse files
Options
Downloads
Patches
Plain Diff
Use pytest-env plugin to manage test settings instead of settings file
parent
f9c64947
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
api/config/settings/test.py
+0
-29
0 additions, 29 deletions
api/config/settings/test.py
api/requirements/test.txt
+1
-0
1 addition, 0 deletions
api/requirements/test.txt
api/setup.cfg
+7
-1
7 additions, 1 deletion
api/setup.cfg
api/tests/conftest.py
+2
-2
2 additions, 2 deletions
api/tests/conftest.py
with
10 additions
and
32 deletions
api/config/settings/test.py
deleted
100644 → 0
+
0
−
29
View file @
f9c64947
from
.common
import
*
# noqa
SECRET_KEY
=
env
(
"
DJANGO_SECRET_KEY
"
,
default
=
'
test
'
)
# Mail settings
# ------------------------------------------------------------------------------
EMAIL_HOST
=
'
localhost
'
EMAIL_PORT
=
1025
EMAIL_BACKEND
=
env
(
'
DJANGO_EMAIL_BACKEND
'
,
default
=
'
django.core.mail.backends.console.EmailBackend
'
)
# CACHING
# ------------------------------------------------------------------------------
CACHES
=
{
'
default
'
:
{
'
BACKEND
'
:
'
django.core.cache.backends.locmem.LocMemCache
'
,
'
LOCATION
'
:
''
}
}
CELERY_BROKER_URL
=
'
memory://
'
########## CELERY
# In development, all tasks will be executed locally by blocking until the task returns
CELERY_TASK_ALWAYS_EAGER
=
True
########## END CELERY
# Your local stuff: Below this line define 3rd party library settings
API_AUTHENTICATION_REQUIRED
=
False
CACHEOPS_ENABLED
=
False
This diff is collapsed.
Click to expand it.
api/requirements/test.txt
+
1
−
0
View file @
22370d1b
...
...
@@ -10,4 +10,5 @@ pytest-mock
pytest-sugar
pytest-xdist
pytest-cov
pytest-env
requests-mock
This diff is collapsed.
Click to expand it.
api/setup.cfg
+
7
−
1
View file @
22370d1b
...
...
@@ -7,6 +7,12 @@ max-line-length = 120
exclude=.tox,.git,*/migrations/*,*/static/CACHE/*,docs,node_modules
[tool:pytest]
DJANGO_SETTINGS_MODULE=config.settings.test
python_files
= tests.py test_
*
.py
*
_tests.py
testpaths
= tests
env
=
SECRET_KEY=test
DJANGO_EMAIL_BACKEND=django.core.mail.backends.console.EmailBackend
CELERY_BROKER_URL=memory://
CELERY_TASK_ALWAYS_EAGER=True
CACHEOPS_ENABLED=False
FEDERATION_HOSTNAME=test.federation
This diff is collapsed.
Click to expand it.
api/tests/conftest.py
+
2
−
2
View file @
22370d1b
import
factory
import
tempfile
import
shutil
import
pytest
import
requests_mock
import
shutil
import
tempfile
from
django.contrib.auth.models
import
AnonymousUser
from
django.core.cache
import
cache
as
django_cache
...
...
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