Пример #1
0
 def test_default_duration_minutes(self):
     """Verify that duration minutes defaults to zero if not set."""
     obj = Method(
         protocol=ProtocolFactory(),
         checklist=ChecklistFactory(),
         time=time(12, 0, 0),
     )
     obj.save()
     self.assertEqual(0, obj.duration_minutes)
Пример #2
0
 def test_default_area(self):
     """Verify that area defaults to zero if not set."""
     obj = Method(
         protocol=ProtocolFactory(),
         checklist=ChecklistFactory(),
         time=time(12, 0, 0)
     )
     obj.save()
     self.assertEqual(0, obj.area)
Пример #3
0
    def test_method_is_optional(self):
        """Verify method is optional."""
        method = Method(
            protocol=ProtocolFactory(),
            checklist=ChecklistFactory(),
            time=timezone.now().time(),
        )
        method.save()

        method.checklist.method.delete()
        method.checklist.save()