예제 #1
0
 def test_soft_deleted_indicators_hidden(self):
     program = RFProgramFactory()
     IndicatorFactory(program=program)
     IndicatorFactory(program=program)
     deleted_indicator = IndicatorFactory(program=program)
     deleted_indicator.delete()
     self.assertEqual(len(program.indicator_set.all()), 2)
     self.assertEqual(
         len(Indicator.rf_aware_objects.filter(program=program)), 2)
class TestIndicatorInstance(test.TestCase):
    def setUp(self):
        self.level = LevelFactory()
        self.indicator = IndicatorFactory(name="testname", level=self.level)

    def tearDown(self):
        self.level.delete()
        self.indicator.delete()

    def test_instances(self):
        indicators = IPTTIndicator.notargets.all()
        self.assertEqual(len(indicators), 1)
        self.assertEqual(indicators[0].name, self.indicator.name)

    def test_level(self):
        indicator = IPTTIndicator.notargets.first()
        self.assertEqual(indicator.level_name, self.level.name)