1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

closes #4368 - extras features model registration

This commit is contained in:
John Anderson
2020-03-14 03:03:22 -04:00
parent c5776d9da4
commit 9466802a95
15 changed files with 172 additions and 185 deletions

View File

@@ -8,9 +8,9 @@ from rest_framework import status
from dcim.models import Device, DeviceRole, DeviceType, Manufacturer, Platform, Rack, RackGroup, RackRole, Region, Site
from extras.api.views import ScriptViewSet
from extras.choices import *
from extras.constants import GRAPH_MODELS
from extras.models import ConfigContext, Graph, ExportTemplate, Tag
from extras.scripts import BooleanVar, IntegerVar, Script, StringVar
from extras.utils import FeatureQuerySet
from tenancy.models import Tenant, TenantGroup
from utilities.testing import APITestCase, choices_to_dict
@@ -35,7 +35,7 @@ class AppTest(APITestCase):
self.assertEqual(choices_to_dict(response.data.get('export-template:template_language')), TemplateLanguageChoices.as_dict())
# Graph
content_types = ContentType.objects.filter(GRAPH_MODELS)
content_types = ContentType.objects.filter(FeatureQuerySet('graphs').get_queryset())
graph_type_choices = {
"{}.{}".format(ct.app_label, ct.model): ct.name for ct in content_types
}