Skip secondary check if get_absolute_url() not defined for model

This commit is contained in:
Jeremy Stretch 2021-03-16 16:48:08 -04:00
parent 9cba554ec9
commit a0fe83bdfa

View File

@ -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)