def formatted_threshold(self):
        """
        Return a formatted abandoned evidence threshold as a string.

        :returns: the AE threshold as 'd days, h hours, m minutes, s seconds'
        """
        return parse_seconds(
            self.config.get('org.auditree.abandoned_evidence.threshold',
                            AE_DEFAULT))
 def test_free_form_mix(self):
     """Ensure that proper string is returned when expected."""
     self.assertEqual(parse_seconds(86410), '1 day, 10 seconds')
     self.assertEqual(parse_seconds(123456),
                      '1 day, 10 hours, 17 minutes, 36 seconds')
 def test_plural_form(self):
     """Ensure that plural form is returned when expected."""
     self.assertEqual(parse_seconds(172800), '2 days')
     self.assertEqual(parse_seconds(7200), '2 hours')
     self.assertEqual(parse_seconds(120), '2 minutes')
     self.assertEqual(parse_seconds(2), '2 seconds')
 def test_singular_form(self):
     """Ensure that singular form is returned when expected."""
     self.assertEqual(parse_seconds(86400), '1 day')
     self.assertEqual(parse_seconds(3600), '1 hour')
     self.assertEqual(parse_seconds(60), '1 minute')
     self.assertEqual(parse_seconds(1), '1 second')