mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-17 21:18:16 -06:00
14438 fix tests
This commit is contained in:
parent
d9afaf9052
commit
84b4085a1f
@ -777,18 +777,14 @@ class ScriptTest(APITestCase):
|
|||||||
is_valid=True,
|
is_valid=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
# def get_test_script(self, *args):
|
|
||||||
# return ScriptModule.objects.first(), self.TestScriptClass
|
|
||||||
|
|
||||||
def python_class(self):
|
def python_class(self):
|
||||||
return self.TestScriptClass
|
return self.TestScriptClass
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super().setUp()
|
super().setUp()
|
||||||
|
|
||||||
# Monkey-patch the API viewset's _get_script() method to return our test Script above
|
# Monkey-patch the Script model to return our TestScriptClass above
|
||||||
from extras.api.views import ScriptViewSet
|
from extras.api.views import ScriptViewSet
|
||||||
# ScriptViewSet._get_script = self.get_test_script
|
|
||||||
Script.python_class = self.python_class
|
Script.python_class = self.python_class
|
||||||
|
|
||||||
def test_get_script(self):
|
def test_get_script(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user