Replies: 1 comment
-
I think you should create an issue to discuss this further. It would be great to run test cases for my plugins this way |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, NetBox team!
I am writing a plugin for NetBox and want to use APIViewTestCases and ViewTestCases in tests. But they don't work because test cases don't know that plugins namespaces are extended by
plugins:
andplugins-api:
. GraphQLTestCase does not work because function dynamic_import (fromutilities/utils.py
) can't import plugins graphql types.I've made several changes and test cases started working in plugins. NetBox core tests also working. Check changes below.
In API and views test cases checks if
app_label
is insettings.PLUGINS
In GraphQLTestCase I'm using
import_object
(fromextras/plugins/utils.py
) instead ofdynamic_import
for plugins.Tested in 3.3.0 NetBox version.
if this solution is right for you, I can create an issue and pull request. if not, feel free to close this discussion.
Beta Was this translation helpful? Give feedback.
All reactions