Example #1
0
 def test_name_and_description(self, range):
     """
     Tests that the condition proxy classes all return a name and
     description. Unfortunately, the current implementations means
     a valid range and value are required.
     """
     for type, __ in models.Condition.TYPE_CHOICES:
         condition = models.Condition(type=type, range=range, value=5)
         assert all([condition.name, condition.description, str(condition)])
Example #2
0
 def test_name_and_description(self, range):
     """
     Tests that the condition proxy classes all return a name and
     description. Unfortunately, the current implementations means
     a valid range and value are required.
     This test became necessary because the complex name/description logic
     broke with the python_2_unicode_compatible decorator.
     """
     for type, __ in models.Condition.TYPE_CHOICES:
         condition = models.Condition(type=type, range=range, value=5)
         assert all([
             condition.name,
             condition.description,
             six.text_type(condition)])