Added requests-mock dependency and fixture
This commit is contained in:
parent
471d1fe9d7
commit
2f473d7570
|
@ -10,3 +10,4 @@ pytest-mock
|
||||||
pytest-sugar
|
pytest-sugar
|
||||||
pytest-xdist
|
pytest-xdist
|
||||||
pytest-cov
|
pytest-cov
|
||||||
|
requests-mock
|
||||||
|
|
|
@ -2,6 +2,7 @@ import factory
|
||||||
import tempfile
|
import tempfile
|
||||||
import shutil
|
import shutil
|
||||||
import pytest
|
import pytest
|
||||||
|
import requests_mock
|
||||||
|
|
||||||
from django.contrib.auth.models import AnonymousUser
|
from django.contrib.auth.models import AnonymousUser
|
||||||
from django.core.cache import cache as django_cache
|
from django.core.cache import cache as django_cache
|
||||||
|
@ -148,3 +149,9 @@ def media_root(settings):
|
||||||
settings.MEDIA_ROOT = tmp_dir
|
settings.MEDIA_ROOT = tmp_dir
|
||||||
yield settings.MEDIA_ROOT
|
yield settings.MEDIA_ROOT
|
||||||
shutil.rmtree(tmp_dir)
|
shutil.rmtree(tmp_dir)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def r_mock():
|
||||||
|
with requests_mock.mock() as m:
|
||||||
|
yield m
|
||||||
|
|
Loading…
Reference in New Issue