mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-13 02:58:17 -06:00
16145 fix test
This commit is contained in:
parent
b67b4f66da
commit
452ba22bd8
@ -777,8 +777,10 @@ class ScriptTest(APITestCase):
|
|||||||
is_executable=True,
|
is_executable=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
def python_class(self):
|
def get_vars(self, *args):
|
||||||
return self.TestScriptClass
|
return {
|
||||||
|
k: v.__class__.__name__ for k, v in self.TestScriptClass._get_vars().items()
|
||||||
|
}
|
||||||
|
|
||||||
def get_test_script(self, *args):
|
def get_test_script(self, *args):
|
||||||
module = ScriptModule.objects.first()
|
module = ScriptModule.objects.first()
|
||||||
@ -790,6 +792,8 @@ class ScriptTest(APITestCase):
|
|||||||
# Monkey-patch the Script model to return our TestScriptClass 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
|
ScriptViewSet._get_script = self.get_test_script
|
||||||
|
from extras.api.serializers_.scripts import ScriptSerializer
|
||||||
|
ScriptSerializer.get_vars = self.get_vars
|
||||||
|
|
||||||
def test_get_script(self):
|
def test_get_script(self):
|
||||||
module = ScriptModule.objects.get(
|
module = ScriptModule.objects.get(
|
||||||
|
Loading…
Reference in New Issue
Block a user