Explorar o código

Skip secondary check if get_absolute_url() not defined for model

Jeremy Stretch %!s(int64=5) %!d(string=hai) anos
pai
achega
7f1d9aeaf8
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      netbox/utilities/testing/views.py

+ 1 - 1
netbox/utilities/testing/views.py

@@ -580,7 +580,7 @@ class ViewTestCases:
             if hasattr(self.model, 'name'):
                 self.assertIn(instance1.name, content)
                 self.assertNotIn(instance2.name, content)
-            else:
+            elif hasattr(self.model, 'get_absolute_url'):
                 self.assertIn(instance1.get_absolute_url(), content)
                 self.assertNotIn(instance2.get_absolute_url(), content)