mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Adapted integration.modules.django
to use salttesting.mock
This commit is contained in:
parent
6d06e12e22
commit
57a69f1ff8
@ -4,23 +4,17 @@ Test the django module
|
|||||||
# Import Salt Testing libs
|
# Import Salt Testing libs
|
||||||
from salttesting import skipIf
|
from salttesting import skipIf
|
||||||
from salttesting.helpers import ensure_in_syspath
|
from salttesting.helpers import ensure_in_syspath
|
||||||
|
from salttesting.mock import NO_MOCK, NO_MOCK_REASON, MagicMock, patch
|
||||||
ensure_in_syspath('../../')
|
ensure_in_syspath('../../')
|
||||||
|
|
||||||
# Import salt libs
|
# Import salt libs
|
||||||
import integration
|
import integration
|
||||||
from salt.modules import djangomod as django
|
from salt.modules import djangomod as django
|
||||||
|
|
||||||
try:
|
|
||||||
from mock import MagicMock, patch
|
|
||||||
has_mock = True
|
|
||||||
except ImportError:
|
|
||||||
has_mock = False
|
|
||||||
|
|
||||||
|
|
||||||
django.__salt__ = {}
|
django.__salt__ = {}
|
||||||
|
|
||||||
|
|
||||||
@skipIf(has_mock is False, 'mock python module is unavailable')
|
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
||||||
class DjangoModuleTest(integration.ModuleCase):
|
class DjangoModuleTest(integration.ModuleCase):
|
||||||
'''
|
'''
|
||||||
Test the django module
|
Test the django module
|
||||||
|
Loading…
Reference in New Issue
Block a user