mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +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
|
||||
from salttesting import skipIf
|
||||
from salttesting.helpers import ensure_in_syspath
|
||||
from salttesting.mock import NO_MOCK, NO_MOCK_REASON, MagicMock, patch
|
||||
ensure_in_syspath('../../')
|
||||
|
||||
# Import salt libs
|
||||
import integration
|
||||
from salt.modules import djangomod as django
|
||||
|
||||
try:
|
||||
from mock import MagicMock, patch
|
||||
has_mock = True
|
||||
except ImportError:
|
||||
has_mock = False
|
||||
|
||||
|
||||
django.__salt__ = {}
|
||||
|
||||
|
||||
@skipIf(has_mock is False, 'mock python module is unavailable')
|
||||
@skipIf(NO_MOCK, NO_MOCK_REASON)
|
||||
class DjangoModuleTest(integration.ModuleCase):
|
||||
'''
|
||||
Test the django module
|
||||
|
Loading…
Reference in New Issue
Block a user