Просмотр исходного кода

Update tests to match new string representation of ContentTypes

Jeremy Stretch 6 лет назад
Родитель
Сommit
be23230938
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      netbox/dcim/tests/test_api.py
  2. 1 1
      netbox/extras/tests/test_api.py

+ 1 - 1
netbox/dcim/tests/test_api.py

@@ -40,7 +40,7 @@ class AppTest(APITestCase):
         self.assertEqual(choices_to_dict(response.data.get('cable:status')), CableStatusChoices.as_dict())
         content_types = ContentType.objects.filter(CABLE_TERMINATION_MODELS)
         cable_termination_choices = {
-            "{}.{}".format(ct.app_label, ct.model): ct.name for ct in content_types
+            "{}.{}".format(ct.app_label, ct.model): str(ct) for ct in content_types
         }
         self.assertEqual(choices_to_dict(response.data.get('cable:termination_a_type')), cable_termination_choices)
         self.assertEqual(choices_to_dict(response.data.get('cable:termination_b_type')), cable_termination_choices)

+ 1 - 1
netbox/extras/tests/test_api.py

@@ -37,7 +37,7 @@ class AppTest(APITestCase):
         # Graph
         content_types = ContentType.objects.filter(GRAPH_MODELS)
         graph_type_choices = {
-            "{}.{}".format(ct.app_label, ct.model): ct.name for ct in content_types
+            "{}.{}".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())