Removing the moto from repo.
This commit is contained in:
Awais Qureshi
2020-01-02 11:50:26 +05:00
parent 6dbc0e77d2
commit 220cab965f
9 changed files with 52 additions and 98 deletions

View File

@@ -7,7 +7,6 @@ import functools
import sys
from contextlib import contextmanager
import moto
import pytest
from django.dispatch import Signal
from markupsafe import escape
@@ -117,19 +116,22 @@ def skip_signal(signal, **kwargs):
signal.connect(**kwargs)
class MockS3Mixin(object):
class MockS3BotoMixin(object):
"""
TestCase mixin that stubs S3 using the moto library. Note that this will
activate httpretty, which will monkey patch socket.
TestCase mixin that mocks the S3BotoStorage save method and s3 connection.
"""
def setUp(self):
super(MockS3Mixin, self).setUp()
self._mock_s3 = moto.mock_s3_deprecated()
self._mock_s3.start()
super(MockS3BotoMixin, self).setUp()
self._mocked_connection = patch('boto.connect_s3', return_value=Mock())
self.mocked_connection = self._mocked_connection.start()
self.patcher = patch('storages.backends.s3boto.S3BotoStorage.save')
self.patcher.start()
def tearDown(self):
self._mock_s3.stop()
super(MockS3Mixin, self).tearDown()
self._mocked_connection.stop()
self.patcher.stop()
super(MockS3BotoMixin, self).tearDown()
class reprwrapper(object):