from controlcenter import Dashboard, widgets


class EmptyDashboard(Dashboard):
    pass


class MyWidget0(widgets.Widget):
    pass


class MyWidget1(widgets.Widget):
    pass


class NonEmptyDashboard(Dashboard):
    widgets = [
        MyWidget0,
        widgets.Group([MyWidget1])
    ]

from controlcenter import Dashboard, widgets


class EmptyDashboard(Dashboard):
    pass


class MyWidget0(widgets.Widget):
    template_name = 'chart.html'


class MyWidget1(widgets.Widget):
    template_name = 'chart.html'


class NonEmptyDashboard(Dashboard):
    widgets = [
        MyWidget0,
        widgets.Group([MyWidget1])
    ]

Define template_name for test widgets
Tests: Define template_name for test widgets

This avoids an "AssertionError: MyWidget0.template_name is not defined."
on Django 2.1, which no longer silences {% include %} exceptions.

Django deprecation notes:

https://docs.djangoproject.com/en/2.1/internals/deprecation/#deprecation-removed-in-2-1

  from controlcenter import Dashboard, widgets
  
  
  class EmptyDashboard(Dashboard):
      pass
  
  
  class MyWidget0(widgets.Widget):
-     pass
+     template_name = 'chart.html'
  
  
  class MyWidget1(widgets.Widget):
-     pass
+     template_name = 'chart.html'
  
  
  class NonEmptyDashboard(Dashboard):
      widgets = [
          MyWidget0,
          widgets.Group([MyWidget1])
      ]
  
Define template_name for test widgets
## Code Before:
from controlcenter import Dashboard, widgets


class EmptyDashboard(Dashboard):
    pass


class MyWidget0(widgets.Widget):
    pass


class MyWidget1(widgets.Widget):
    pass


class NonEmptyDashboard(Dashboard):
    widgets = [
        MyWidget0,
        widgets.Group([MyWidget1])
    ]

## Instruction:
Define template_name for test widgets
## Code After:
from controlcenter import Dashboard, widgets


class EmptyDashboard(Dashboard):
    pass


class MyWidget0(widgets.Widget):
    template_name = 'chart.html'


class MyWidget1(widgets.Widget):
    template_name = 'chart.html'


class NonEmptyDashboard(Dashboard):
    widgets = [
        MyWidget0,
        widgets.Group([MyWidget1])
    ]
