mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-25 18:08:38 -06:00
Skip secondary check if get_absolute_url() not defined for model
This commit is contained in:
parent
f2c079de87
commit
7f1d9aeaf8
@ -580,7 +580,7 @@ class ViewTestCases:
|
|||||||
if hasattr(self.model, 'name'):
|
if hasattr(self.model, 'name'):
|
||||||
self.assertIn(instance1.name, content)
|
self.assertIn(instance1.name, content)
|
||||||
self.assertNotIn(instance2.name, content)
|
self.assertNotIn(instance2.name, content)
|
||||||
else:
|
elif hasattr(self.model, 'get_absolute_url'):
|
||||||
self.assertIn(instance1.get_absolute_url(), content)
|
self.assertIn(instance1.get_absolute_url(), content)
|
||||||
self.assertNotIn(instance2.get_absolute_url(), content)
|
self.assertNotIn(instance2.get_absolute_url(), content)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user