Added requests-mock dependency and fixture

This commit is contained in:
Eliot Berriot 2018-03-28 18:04:07 +02:00
parent 471d1fe9d7
commit 2f473d7570
No known key found for this signature in database
GPG Key ID: DD6965E2476E5C27
2 changed files with 8 additions and 0 deletions

View File

@ -10,3 +10,4 @@ pytest-mock
pytest-sugar
pytest-xdist
pytest-cov
requests-mock

View File

@ -2,6 +2,7 @@ import factory
import tempfile
import shutil
import pytest
import requests_mock
from django.contrib.auth.models import AnonymousUser
from django.core.cache import cache as django_cache
@ -148,3 +149,9 @@ def media_root(settings):
settings.MEDIA_ROOT = tmp_dir
yield settings.MEDIA_ROOT
shutil.rmtree(tmp_dir)
@pytest.fixture
def r_mock():
with requests_mock.mock() as m:
yield m