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

Remove tests for API _choices endpoints

This commit is contained in:
Jeremy Stretch
2020-03-12 10:48:53 -04:00
parent ea9de37dd1
commit a53f854187
8 changed files with 5 additions and 193 deletions

View File

@@ -7,12 +7,10 @@ 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 tenancy.models import Tenant, TenantGroup
from utilities.testing import APITestCase, choices_to_dict
from utilities.testing import APITestCase
class AppTest(APITestCase):
@@ -24,27 +22,6 @@ class AppTest(APITestCase):
self.assertEqual(response.status_code, 200)
def test_choices(self):
url = reverse('extras-api:field-choice-list')
response = self.client.get(url, **self.header)
self.assertEqual(response.status_code, 200)
# ExportTemplate
self.assertEqual(choices_to_dict(response.data.get('export-template:template_language')), TemplateLanguageChoices.as_dict())
# Graph
content_types = ContentType.objects.filter(GRAPH_MODELS)
graph_type_choices = {
"{}.{}".format(ct.app_label, ct.model): str(ct) for ct in content_types
}
self.assertEqual(choices_to_dict(response.data.get('graph:type')), graph_type_choices)
self.assertEqual(choices_to_dict(response.data.get('graph:template_language')), TemplateLanguageChoices.as_dict())
# ObjectChange
self.assertEqual(choices_to_dict(response.data.get('object-change:action')), ObjectChangeActionChoices.as_dict())
class GraphTest(APITestCase):