diff --git a/api/config/settings/test.py b/api/config/settings/test.py
deleted file mode 100644
index aff29c6571252d1f0d401c550cedf09998a5c512..0000000000000000000000000000000000000000
--- a/api/config/settings/test.py
+++ /dev/null
@@ -1,29 +0,0 @@
-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
diff --git a/api/requirements/test.txt b/api/requirements/test.txt
index e11f26ca75ad36ab5efe1f91d86cd51b04928f9b..20a14abea1685387764012ea5ac3e01d60a09a47 100644
--- a/api/requirements/test.txt
+++ b/api/requirements/test.txt
@@ -10,4 +10,5 @@ pytest-mock
 pytest-sugar
 pytest-xdist
 pytest-cov
+pytest-env
 requests-mock
diff --git a/api/setup.cfg b/api/setup.cfg
index 34daa8c6834452229971467c7876400b842b64c1..a2b8b92c682696a0ad4569cb6c9f9e25c01f9b9f 100644
--- a/api/setup.cfg
+++ b/api/setup.cfg
@@ -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
diff --git a/api/tests/conftest.py b/api/tests/conftest.py
index 2b5a4f799d0fd23cba94372bdf7415a373eafd66..6d5e733120eaf9179dbf58681efeff38b9a78b83 100644
--- a/api/tests/conftest.py
+++ b/api/tests/conftest.py
@@ -1,8 +1,8 @@
 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