Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
retribute.me
api
Commits
75f93916
Verified
Commit
75f93916
authored
May 25, 2019
by
Eliot Berriot
Browse files
Basic test setup
parent
ffcf6520
Changes
6
Hide whitespace changes
Inline
Side-by-side
config/settings/base.py
View file @
75f93916
...
...
@@ -14,7 +14,7 @@ env = environ.Env()
READ_DOT_ENV_FILE
=
env
.
bool
(
"DJANGO_READ_DOT_ENV_FILE"
,
default
=
True
)
if
READ_DOT_ENV_FILE
:
# OS environment variables take precedence over variables from .env
env
.
read_env
(
str
(
ROOT_DIR
.
path
(
".env"
)))
env
.
read_env
(
env
.
bool
(
"DJANGO_DOT_ENV_FILE"
,
default
=
str
(
ROOT_DIR
.
path
(
".env"
)))
)
# GENERAL
# ------------------------------------------------------------------------------
...
...
pytest.ini
deleted
100644 → 0
View file @
ffcf6520
[pytest]
DJANGO_SETTINGS_MODULE
=
config.settings.test
retribute_api/conftest.py
deleted
100644 → 0
View file @
ffcf6520
import
pytest
from
django.conf
import
settings
from
django.test
import
RequestFactory
from
retribute_api.users.tests.factories
import
UserFactory
@
pytest
.
fixture
(
autouse
=
True
)
def
media_storage
(
settings
,
tmpdir
):
settings
.
MEDIA_ROOT
=
tmpdir
.
strpath
@
pytest
.
fixture
def
user
()
->
settings
.
AUTH_USER_MODEL
:
return
UserFactory
()
@
pytest
.
fixture
def
request_factory
()
->
RequestFactory
:
return
RequestFactory
()
setup.cfg
View file @
75f93916
...
...
@@ -46,13 +46,13 @@ dev =
pytest-mock
pytest-env
pytest-sugar
pytest-django
flake8
coverage
black
pylint-django
factory-boy
django-debug-toolbar
pytest-django
[options.packages.find]
...
...
@@ -64,6 +64,13 @@ universal = 1
[tool:pytest]
testpaths = tests
env =
SECRET_KEY=test
EMAIL_CONFIG=consolemail://
DEBUG_TOOLBAR_ENABLED=False
DEBUG=False
WEAK_PASSWORDS=True
[flake8]
max-line-length = 120
...
...
tests/conftest.py
0 → 100644
View file @
75f93916
tests/test_dummy.py
0 → 100644
View file @
75f93916
def
test_something
():
assert
1
==
2
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment