Browse Source

Enable get view tests for organizational objects

Jeremy Stretch 5 years ago
parent
commit
981e7017bb
2 changed files with 1 additions and 10 deletions
  1. 0 10
      netbox/extras/views.py
  2. 1 0
      netbox/utilities/testing/views.py

+ 0 - 10
netbox/extras/views.py

@@ -235,11 +235,6 @@ class ObjectChangeLogView(View):
         # fall back to using base.html.
         # fall back to using base.html.
         if self.base_template is None:
         if self.base_template is None:
             self.base_template = f"{model._meta.app_label}/{model._meta.model_name}.html"
             self.base_template = f"{model._meta.app_label}/{model._meta.model_name}.html"
-            # TODO: This can be removed once an object view has been established for every model.
-            try:
-                template.loader.get_template(self.base_template)
-            except template.TemplateDoesNotExist:
-                self.base_template = 'base.html'
 
 
         return render(request, 'extras/object_changelog.html', {
         return render(request, 'extras/object_changelog.html', {
             'object': obj,
             'object': obj,
@@ -368,11 +363,6 @@ class ObjectJournalView(View):
         # fall back to using base.html.
         # fall back to using base.html.
         if self.base_template is None:
         if self.base_template is None:
             self.base_template = f"{model._meta.app_label}/{model._meta.model_name}.html"
             self.base_template = f"{model._meta.app_label}/{model._meta.model_name}.html"
-            # TODO: This can be removed once an object view has been established for every model.
-            try:
-                template.loader.get_template(self.base_template)
-            except template.TemplateDoesNotExist:
-                self.base_template = 'base.html'
 
 
         return render(request, 'extras/object_journal.html', {
         return render(request, 'extras/object_journal.html', {
             'object': obj,
             'object': obj,

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

@@ -1018,6 +1018,7 @@ class ViewTestCases:
         maxDiff = None
         maxDiff = None
 
 
     class OrganizationalObjectViewTestCase(
     class OrganizationalObjectViewTestCase(
+        GetObjectViewTestCase,
         GetObjectChangelogViewTestCase,
         GetObjectChangelogViewTestCase,
         CreateObjectViewTestCase,
         CreateObjectViewTestCase,
         EditObjectViewTestCase,
         EditObjectViewTestCase,