from openfisca_core.model_api import Variable, Reform, MONTH
from openfisca_country_template.entities import Person


class goes_to_school(Variable):
    value_type = bool
    default_value = True
    entity = Person
    label = "The person goes to school (only relevant for children)"
    definition_period = MONTH


class add_variable_reform(Reform):
    def apply(self):
        self.add_variable(goes_to_school)

from openfisca_core.model_api import Variable, Reform, MONTH
from openfisca_country_template.entities import Person


def test_dynamic_variable():
    class NewDynamicClass(Variable):
        value_type = bool
        default_value = True
        entity = Person
        label = "The person goes to school (only relevant for children)"
        definition_period = MONTH

    NewDynamicClass.__name__ = "goes_to_school"
    return NewDynamicClass


class add_variable_reform(Reform):
    def apply(self):
        self.add_variable(test_dynamic_variable())

Update test reform to make it fail without a fix
Update test reform to make it fail without a fix

  from openfisca_core.model_api import Variable, Reform, MONTH
  from openfisca_country_template.entities import Person
  
  
- class goes_to_school(Variable):
+ def test_dynamic_variable():
+     class NewDynamicClass(Variable):
-     value_type = bool
+         value_type = bool
-     default_value = True
+         default_value = True
-     entity = Person
+         entity = Person
-     label = "The person goes to school (only relevant for children)"
+         label = "The person goes to school (only relevant for children)"
-     definition_period = MONTH
+         definition_period = MONTH
+ 
+     NewDynamicClass.__name__ = "goes_to_school"
+     return NewDynamicClass
  
  
  class add_variable_reform(Reform):
      def apply(self):
-         self.add_variable(goes_to_school)
+         self.add_variable(test_dynamic_variable())
  
Update test reform to make it fail without a fix
## Code Before:
from openfisca_core.model_api import Variable, Reform, MONTH
from openfisca_country_template.entities import Person


class goes_to_school(Variable):
    value_type = bool
    default_value = True
    entity = Person
    label = "The person goes to school (only relevant for children)"
    definition_period = MONTH


class add_variable_reform(Reform):
    def apply(self):
        self.add_variable(goes_to_school)

## Instruction:
Update test reform to make it fail without a fix
## Code After:
from openfisca_core.model_api import Variable, Reform, MONTH
from openfisca_country_template.entities import Person


def test_dynamic_variable():
    class NewDynamicClass(Variable):
        value_type = bool
        default_value = True
        entity = Person
        label = "The person goes to school (only relevant for children)"
        definition_period = MONTH

    NewDynamicClass.__name__ = "goes_to_school"
    return NewDynamicClass


class add_variable_reform(Reform):
    def apply(self):
        self.add_variable(test_dynamic_variable())
